This commit is contained in:
孟帅
2022-11-24 23:37:34 +08:00
parent 4ffe54b6ac
commit 29bda0dcdd
1487 changed files with 97869 additions and 96539 deletions

View File

@@ -0,0 +1,7 @@
/**
* 全局注册自定义组件 待完善
* @param app
*/
export function setupCustomComponents() {
// app.component()
}

View 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);
}

View File

@@ -0,0 +1,5 @@
/**
* 注册全局方法 待完善
* @param app
*/
export function setupGlobalMethods() {}

4
web/src/plugins/index.ts Normal file
View 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';

143
web/src/plugins/naive.ts Normal file
View File

@@ -0,0 +1,143 @@
import type { App } from 'vue';
import {
create,
NConfigProvider,
NMessageProvider,
NDialogProvider,
NInput,
NButton,
NForm,
NFormItem,
NCheckboxGroup,
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,
NSelect,
NRadioGroup,
NRadio,
NSteps,
NStep,
NInputGroup,
NResult,
NDescriptions,
NDescriptionsItem,
NTable,
NInputNumber,
NLoadingBarProvider,
NModal,
NUpload,
NTree,
NSpin,
NTimePicker,
NBackTop,
NSkeleton,
} from 'naive-ui';
const naive = create({
components: [
NMessageProvider,
NDialogProvider,
NConfigProvider,
NInput,
NButton,
NForm,
NFormItem,
NCheckboxGroup,
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,
NSelect,
NRadioGroup,
NRadio,
NSteps,
NStep,
NInputGroup,
NResult,
NDescriptions,
NDescriptionsItem,
NTable,
NInputNumber,
NLoadingBarProvider,
NModal,
NUpload,
NTree,
NSpin,
NTimePicker,
NBackTop,
NSkeleton,
],
});
export function setupNaive(app: App<Element>) {
app.use(naive);
}