feat(projects): 添加naiveUI按需引入

This commit is contained in:
Soybean
2022-02-17 00:58:55 +08:00
parent 225e7128b6
commit a810ef85b1
69 changed files with 231 additions and 120 deletions

View File

@ -1,3 +1,4 @@
import setupAssets from './assets';
import setupNaiveUI from './naive';
export { setupAssets };
export { setupAssets, setupNaiveUI };

103
src/plugins/naive.ts Normal file
View File

@ -0,0 +1,103 @@
import type { App } from 'vue';
import {
create,
NBreadcrumb,
NBreadcrumbItem,
NButton,
NCard,
NCheckbox,
NColorPicker,
NConfigProvider,
NDataTable,
NDescriptions,
NDescriptionsItem,
NDialogProvider,
NDivider,
NDrawer,
NDrawerContent,
NDropdown,
NEmpty,
NForm,
NFormItem,
NGradientText,
NGrid,
NGridItem,
NInput,
NInputGroup,
NInputNumber,
NList,
NListItem,
NLoadingBarProvider,
NModal,
NMenu,
NMessageProvider,
NNotificationProvider,
NPopover,
NScrollbar,
NSelect,
NSpace,
NStatistic,
NSwitch,
NSpin,
NTabs,
NTabPane,
NTag,
NThing,
NTimeline,
NTimelineItem,
NTooltip
} from 'naive-ui';
/** 按需引入naiveUI */
export default function setupNaiveUI(app: App) {
const naive = create({
components: [
NBreadcrumb,
NBreadcrumbItem,
NButton,
NCard,
NCheckbox,
NColorPicker,
NConfigProvider,
NDataTable,
NDescriptions,
NDescriptionsItem,
NDialogProvider,
NDivider,
NDrawer,
NDrawerContent,
NDropdown,
NEmpty,
NForm,
NFormItem,
NGradientText,
NGrid,
NGridItem,
NInput,
NInputGroup,
NInputNumber,
NList,
NListItem,
NLoadingBarProvider,
NModal,
NMenu,
NMessageProvider,
NNotificationProvider,
NPopover,
NScrollbar,
NSelect,
NSpace,
NStatistic,
NSwitch,
NSpin,
NTabs,
NTabPane,
NTag,
NThing,
NTimeline,
NTimelineItem,
NTooltip
]
});
app.use(naive);
}