mirror of
https://github.com/jekip/naive-ui-admin.git
synced 2026-02-13 09:42:27 +08:00
更新0.1.1版本
This commit is contained in:
9
src/plugins/customComponents.ts
Normal file
9
src/plugins/customComponents.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { App } from 'vue'
|
||||
|
||||
/**
|
||||
* 全局注册自定义组件 待完善
|
||||
* @param app
|
||||
*/
|
||||
export function setupCustomComponents(app: App) {
|
||||
// app.component()
|
||||
}
|
||||
12
src/plugins/directives.ts
Normal file
12
src/plugins/directives.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { App } from 'vue'
|
||||
|
||||
import { permission } from '@/directives/permission'
|
||||
|
||||
/**
|
||||
* 注册全局自定义指令
|
||||
* @param app
|
||||
*/
|
||||
export function setupDirectives(app: App) {
|
||||
// 权限控制指令(演示)
|
||||
app.directive('permission', permission)
|
||||
}
|
||||
9
src/plugins/globalMethods.ts
Normal file
9
src/plugins/globalMethods.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { App } from 'vue'
|
||||
|
||||
/**
|
||||
* 注册全局方法 待完善
|
||||
* @param app
|
||||
*/
|
||||
export function setupGlobalMethods(app: App) {
|
||||
|
||||
}
|
||||
4
src/plugins/index.ts
Normal file
4
src/plugins/index.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export { setupNaive } from '@/plugins/naive'
|
||||
export { setupDirectives } from '@/plugins/directives'
|
||||
export { setupCustomComponents } from '@/plugins/customComponents'
|
||||
export { setupGlobalMethods } from '@/plugins/globalMethods'
|
||||
103
src/plugins/naive.ts
Normal file
103
src/plugins/naive.ts
Normal file
@@ -0,0 +1,103 @@
|
||||
import type { App } from 'vue'
|
||||
import {
|
||||
create,
|
||||
NConfigProvider,
|
||||
NMessageProvider,
|
||||
NDialogProvider,
|
||||
NInput,
|
||||
NButton,
|
||||
NForm,
|
||||
NFormItem,
|
||||
NCheckbox,
|
||||
NIcon,
|
||||
NLayout,
|
||||
NLayoutHeader,
|
||||
NLayoutContent,
|
||||
NLayoutFooter,
|
||||
NLayoutSider,
|
||||
NMenu,
|
||||
NBreadcrumb,
|
||||
NBreadcrumbItem,
|
||||
NDropdown,
|
||||
NSpace,
|
||||
NTooltip,
|
||||
NAvatar,
|
||||
NTabs,
|
||||
NTabPane,
|
||||
NCard,
|
||||
NRow,
|
||||
NCol,
|
||||
NDrawer,
|
||||
NDrawerContent,
|
||||
NDivider,
|
||||
NSwitch,
|
||||
NBadge,
|
||||
NAlert,
|
||||
NElement,
|
||||
NTag,
|
||||
NNotificationProvider,
|
||||
NProgress,
|
||||
NDatePicker,
|
||||
NGrid,
|
||||
NGridItem,
|
||||
NList,
|
||||
NListItem,
|
||||
NThing,
|
||||
NDataTable,
|
||||
NPopover,
|
||||
NPagination
|
||||
} from 'naive-ui'
|
||||
|
||||
const naive = create({
|
||||
components: [
|
||||
NMessageProvider,
|
||||
NDialogProvider,
|
||||
NConfigProvider,
|
||||
NInput,
|
||||
NButton,
|
||||
NForm,
|
||||
NFormItem,
|
||||
NCheckbox,
|
||||
NIcon,
|
||||
NLayout,
|
||||
NLayoutHeader,
|
||||
NLayoutContent,
|
||||
NLayoutFooter,
|
||||
NLayoutSider,
|
||||
NMenu,
|
||||
NBreadcrumb,
|
||||
NBreadcrumbItem,
|
||||
NDropdown,
|
||||
NSpace,
|
||||
NTooltip,
|
||||
NAvatar,
|
||||
NTabs,
|
||||
NTabPane,
|
||||
NCard,
|
||||
NRow,
|
||||
NCol,
|
||||
NDrawer,
|
||||
NDrawerContent,
|
||||
NDivider,
|
||||
NSwitch,
|
||||
NBadge,
|
||||
NAlert,
|
||||
NElement,
|
||||
NTag,
|
||||
NNotificationProvider,
|
||||
NProgress,
|
||||
NDatePicker,
|
||||
NGrid,
|
||||
NGridItem,
|
||||
NList,
|
||||
NListItem,
|
||||
NThing,
|
||||
NDataTable,
|
||||
NPopover,
|
||||
NPagination
|
||||
]
|
||||
})
|
||||
|
||||
export function setupNaive(app: App<Element>) {
|
||||
app.use(naive)
|
||||
}
|
||||
Reference in New Issue
Block a user