feat(auto-import): 添加 naive-ui 组件自动导入支持
All checks were successful
CI/CD Pipeline / playwright (push) Successful in 4m8s
CI/CD Pipeline / build-and-deploy (push) Successful in 2m35s

This commit is contained in:
严浩
2025-10-25 00:47:07 +08:00
parent 699b68990e
commit d0f1ad0702
4 changed files with 351 additions and 11 deletions

308
auto-imports.d.ts vendored
View File

@@ -8,6 +8,160 @@ export {}
declare global {
const APP_THEME_MODES: typeof import('./src/stores/app-store')['APP_THEME_MODES']
const EffectScope: typeof import('vue')['EffectScope']
const NA: typeof import('naive-ui')['NA']
const NAffix: typeof import('naive-ui')['NAffix']
const NAlert: typeof import('naive-ui')['NAlert']
const NAnchor: typeof import('naive-ui')['NAnchor']
const NAnchorLink: typeof import('naive-ui')['NAnchorLink']
const NAutoComplete: typeof import('naive-ui')['NAutoComplete']
const NAvatar: typeof import('naive-ui')['NAvatar']
const NAvatarGroup: typeof import('naive-ui')['NAvatarGroup']
const NBackTop: typeof import('naive-ui')['NBackTop']
const NBadge: typeof import('naive-ui')['NBadge']
const NBlockquote: typeof import('naive-ui')['NBlockquote']
const NBreadcrumb: typeof import('naive-ui')['NBreadcrumb']
const NBreadcrumbItem: typeof import('naive-ui')['NBreadcrumbItem']
const NButton: typeof import('naive-ui')['NButton']
const NButtonGroup: typeof import('naive-ui')['NButtonGroup']
const NCalendar: typeof import('naive-ui')['NCalendar']
const NCard: typeof import('naive-ui')['NCard']
const NCarousel: typeof import('naive-ui')['NCarousel']
const NCarouselItem: typeof import('naive-ui')['NCarouselItem']
const NCascader: typeof import('naive-ui')['NCascader']
const NCheckbox: typeof import('naive-ui')['NCheckbox']
const NCheckboxGroup: typeof import('naive-ui')['NCheckboxGroup']
const NCode: typeof import('naive-ui')['NCode']
const NCol: typeof import('naive-ui')['NCol']
const NCollapse: typeof import('naive-ui')['NCollapse']
const NCollapseItem: typeof import('naive-ui')['NCollapseItem']
const NCollapseTransition: typeof import('naive-ui')['NCollapseTransition']
const NColorPicker: typeof import('naive-ui')['NColorPicker']
const NConfigProvider: typeof import('naive-ui')['NConfigProvider']
const NCountdown: typeof import('naive-ui')['NCountdown']
const NDataTable: typeof import('naive-ui')['NDataTable']
const NDatePicker: typeof import('naive-ui')['NDatePicker']
const NDescriptions: typeof import('naive-ui')['NDescriptions']
const NDescriptionsItem: typeof import('naive-ui')['NDescriptionsItem']
const NDialog: typeof import('naive-ui')['NDialog']
const NDialogProvider: typeof import('naive-ui')['NDialogProvider']
const NDivider: typeof import('naive-ui')['NDivider']
const NDrawer: typeof import('naive-ui')['NDrawer']
const NDrawerContent: typeof import('naive-ui')['NDrawerContent']
const NDropdown: typeof import('naive-ui')['NDropdown']
const NDynamicInput: typeof import('naive-ui')['NDynamicInput']
const NDynamicTags: typeof import('naive-ui')['NDynamicTags']
const NEl: typeof import('naive-ui')['NEl']
const NElement: typeof import('naive-ui')['NElement']
const NEllipsis: typeof import('naive-ui')['NEllipsis']
const NEmpty: typeof import('naive-ui')['NEmpty']
const NEquation: typeof import('naive-ui')['NEquation']
const NFlex: typeof import('naive-ui')['NFlex']
const NFloatButton: typeof import('naive-ui')['NFloatButton']
const NFloatButtonGroup: typeof import('naive-ui')['NFloatButtonGroup']
const NForm: typeof import('naive-ui')['NForm']
const NFormItem: typeof import('naive-ui')['NFormItem']
const NFormItemCol: typeof import('naive-ui')['NFormItemCol']
const NFormItemGi: typeof import('naive-ui')['NFormItemGi']
const NFormItemGridItem: typeof import('naive-ui')['NFormItemGridItem']
const NFormItemRow: typeof import('naive-ui')['NFormItemRow']
const NGi: typeof import('naive-ui')['NGi']
const NGlobalStyle: typeof import('naive-ui')['NGlobalStyle']
const NGradientText: typeof import('naive-ui')['NGradientText']
const NGrid: typeof import('naive-ui')['NGrid']
const NGridItem: typeof import('naive-ui')['NGridItem']
const NH1: typeof import('naive-ui')['NH1']
const NH2: typeof import('naive-ui')['NH2']
const NH3: typeof import('naive-ui')['NH3']
const NH4: typeof import('naive-ui')['NH4']
const NH5: typeof import('naive-ui')['NH5']
const NH6: typeof import('naive-ui')['NH6']
const NHeatmap: typeof import('naive-ui')['NHeatmap']
const NHighlight: typeof import('naive-ui')['NHighlight']
const NHr: typeof import('naive-ui')['NHr']
const NIcon: typeof import('naive-ui')['NIcon']
const NIconWrapper: typeof import('naive-ui')['NIconWrapper']
const NImage: typeof import('naive-ui')['NImage']
const NImageGroup: typeof import('naive-ui')['NImageGroup']
const NImagePreview: typeof import('naive-ui')['NImagePreview']
const NInfiniteScroll: typeof import('naive-ui')['NInfiniteScroll']
const NInput: typeof import('naive-ui')['NInput']
const NInputGroup: typeof import('naive-ui')['NInputGroup']
const NInputGroupLabel: typeof import('naive-ui')['NInputGroupLabel']
const NInputNumber: typeof import('naive-ui')['NInputNumber']
const NInputOtp: typeof import('naive-ui')['NInputOtp']
const NLayout: typeof import('naive-ui')['NLayout']
const NLayoutContent: typeof import('naive-ui')['NLayoutContent']
const NLayoutFooter: typeof import('naive-ui')['NLayoutFooter']
const NLayoutHeader: typeof import('naive-ui')['NLayoutHeader']
const NLayoutSider: typeof import('naive-ui')['NLayoutSider']
const NLegacyTransfer: typeof import('naive-ui')['NLegacyTransfer']
const NLi: typeof import('naive-ui')['NLi']
const NList: typeof import('naive-ui')['NList']
const NListItem: typeof import('naive-ui')['NListItem']
const NLoadingBarProvider: typeof import('naive-ui')['NLoadingBarProvider']
const NLog: typeof import('naive-ui')['NLog']
const NMarquee: typeof import('naive-ui')['NMarquee']
const NMention: typeof import('naive-ui')['NMention']
const NMenu: typeof import('naive-ui')['NMenu']
const NMessageProvider: typeof import('naive-ui')['NMessageProvider']
const NModal: typeof import('naive-ui')['NModal']
const NModalProvider: typeof import('naive-ui')['NModalProvider']
const NNotificationProvider: typeof import('naive-ui')['NNotificationProvider']
const NNumberAnimation: typeof import('naive-ui')['NNumberAnimation']
const NOl: typeof import('naive-ui')['NOl']
const NP: typeof import('naive-ui')['NP']
const NPageHeader: typeof import('naive-ui')['NPageHeader']
const NPagination: typeof import('naive-ui')['NPagination']
const NPerformantEllipsis: typeof import('naive-ui')['NPerformantEllipsis']
const NPopconfirm: typeof import('naive-ui')['NPopconfirm']
const NPopover: typeof import('naive-ui')['NPopover']
const NPopselect: typeof import('naive-ui')['NPopselect']
const NProgress: typeof import('naive-ui')['NProgress']
const NQrCode: typeof import('naive-ui')['NQrCode']
const NRadio: typeof import('naive-ui')['NRadio']
const NRadioButton: typeof import('naive-ui')['NRadioButton']
const NRadioGroup: typeof import('naive-ui')['NRadioGroup']
const NRate: typeof import('naive-ui')['NRate']
const NResult: typeof import('naive-ui')['NResult']
const NRow: typeof import('naive-ui')['NRow']
const NScrollbar: typeof import('naive-ui')['NScrollbar']
const NSelect: typeof import('naive-ui')['NSelect']
const NSkeleton: typeof import('naive-ui')['NSkeleton']
const NSlider: typeof import('naive-ui')['NSlider']
const NSpace: typeof import('naive-ui')['NSpace']
const NSpin: typeof import('naive-ui')['NSpin']
const NSplit: typeof import('naive-ui')['NSplit']
const NStatistic: typeof import('naive-ui')['NStatistic']
const NStep: typeof import('naive-ui')['NStep']
const NSteps: typeof import('naive-ui')['NSteps']
const NSwitch: typeof import('naive-ui')['NSwitch']
const NTab: typeof import('naive-ui')['NTab']
const NTabPane: typeof import('naive-ui')['NTabPane']
const NTable: typeof import('naive-ui')['NTable']
const NTabs: typeof import('naive-ui')['NTabs']
const NTag: typeof import('naive-ui')['NTag']
const NTbody: typeof import('naive-ui')['NTbody']
const NTd: typeof import('naive-ui')['NTd']
const NText: typeof import('naive-ui')['NText']
const NTh: typeof import('naive-ui')['NTh']
const NThead: typeof import('naive-ui')['NThead']
const NThing: typeof import('naive-ui')['NThing']
const NTime: typeof import('naive-ui')['NTime']
const NTimePicker: typeof import('naive-ui')['NTimePicker']
const NTimeline: typeof import('naive-ui')['NTimeline']
const NTimelineItem: typeof import('naive-ui')['NTimelineItem']
const NTooltip: typeof import('naive-ui')['NTooltip']
const NTr: typeof import('naive-ui')['NTr']
const NTransfer: typeof import('naive-ui')['NTransfer']
const NTree: typeof import('naive-ui')['NTree']
const NTreeSelect: typeof import('naive-ui')['NTreeSelect']
const NUl: typeof import('naive-ui')['NUl']
const NUpload: typeof import('naive-ui')['NUpload']
const NUploadDragger: typeof import('naive-ui')['NUploadDragger']
const NUploadFileList: typeof import('naive-ui')['NUploadFileList']
const NUploadTrigger: typeof import('naive-ui')['NUploadTrigger']
const NVirtualList: typeof import('naive-ui')['NVirtualList']
const NWatermark: typeof import('naive-ui')['NWatermark']
const acceptHMRUpdate: typeof import('pinia')['acceptHMRUpdate']
const arrayToTree: typeof import('utils4u/array')['arrayToTree']
const asyncComputed: typeof import('@vueuse/core')['asyncComputed']
@@ -346,6 +500,160 @@ declare module 'vue' {
interface ComponentCustomProperties {
readonly APP_THEME_MODES: UnwrapRef<typeof import('./src/stores/app-store')['APP_THEME_MODES']>
readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']>
readonly NA: UnwrapRef<typeof import('naive-ui')['NA']>
readonly NAffix: UnwrapRef<typeof import('naive-ui')['NAffix']>
readonly NAlert: UnwrapRef<typeof import('naive-ui')['NAlert']>
readonly NAnchor: UnwrapRef<typeof import('naive-ui')['NAnchor']>
readonly NAnchorLink: UnwrapRef<typeof import('naive-ui')['NAnchorLink']>
readonly NAutoComplete: UnwrapRef<typeof import('naive-ui')['NAutoComplete']>
readonly NAvatar: UnwrapRef<typeof import('naive-ui')['NAvatar']>
readonly NAvatarGroup: UnwrapRef<typeof import('naive-ui')['NAvatarGroup']>
readonly NBackTop: UnwrapRef<typeof import('naive-ui')['NBackTop']>
readonly NBadge: UnwrapRef<typeof import('naive-ui')['NBadge']>
readonly NBlockquote: UnwrapRef<typeof import('naive-ui')['NBlockquote']>
readonly NBreadcrumb: UnwrapRef<typeof import('naive-ui')['NBreadcrumb']>
readonly NBreadcrumbItem: UnwrapRef<typeof import('naive-ui')['NBreadcrumbItem']>
readonly NButton: UnwrapRef<typeof import('naive-ui')['NButton']>
readonly NButtonGroup: UnwrapRef<typeof import('naive-ui')['NButtonGroup']>
readonly NCalendar: UnwrapRef<typeof import('naive-ui')['NCalendar']>
readonly NCard: UnwrapRef<typeof import('naive-ui')['NCard']>
readonly NCarousel: UnwrapRef<typeof import('naive-ui')['NCarousel']>
readonly NCarouselItem: UnwrapRef<typeof import('naive-ui')['NCarouselItem']>
readonly NCascader: UnwrapRef<typeof import('naive-ui')['NCascader']>
readonly NCheckbox: UnwrapRef<typeof import('naive-ui')['NCheckbox']>
readonly NCheckboxGroup: UnwrapRef<typeof import('naive-ui')['NCheckboxGroup']>
readonly NCode: UnwrapRef<typeof import('naive-ui')['NCode']>
readonly NCol: UnwrapRef<typeof import('naive-ui')['NCol']>
readonly NCollapse: UnwrapRef<typeof import('naive-ui')['NCollapse']>
readonly NCollapseItem: UnwrapRef<typeof import('naive-ui')['NCollapseItem']>
readonly NCollapseTransition: UnwrapRef<typeof import('naive-ui')['NCollapseTransition']>
readonly NColorPicker: UnwrapRef<typeof import('naive-ui')['NColorPicker']>
readonly NConfigProvider: UnwrapRef<typeof import('naive-ui')['NConfigProvider']>
readonly NCountdown: UnwrapRef<typeof import('naive-ui')['NCountdown']>
readonly NDataTable: UnwrapRef<typeof import('naive-ui')['NDataTable']>
readonly NDatePicker: UnwrapRef<typeof import('naive-ui')['NDatePicker']>
readonly NDescriptions: UnwrapRef<typeof import('naive-ui')['NDescriptions']>
readonly NDescriptionsItem: UnwrapRef<typeof import('naive-ui')['NDescriptionsItem']>
readonly NDialog: UnwrapRef<typeof import('naive-ui')['NDialog']>
readonly NDialogProvider: UnwrapRef<typeof import('naive-ui')['NDialogProvider']>
readonly NDivider: UnwrapRef<typeof import('naive-ui')['NDivider']>
readonly NDrawer: UnwrapRef<typeof import('naive-ui')['NDrawer']>
readonly NDrawerContent: UnwrapRef<typeof import('naive-ui')['NDrawerContent']>
readonly NDropdown: UnwrapRef<typeof import('naive-ui')['NDropdown']>
readonly NDynamicInput: UnwrapRef<typeof import('naive-ui')['NDynamicInput']>
readonly NDynamicTags: UnwrapRef<typeof import('naive-ui')['NDynamicTags']>
readonly NEl: UnwrapRef<typeof import('naive-ui')['NEl']>
readonly NElement: UnwrapRef<typeof import('naive-ui')['NElement']>
readonly NEllipsis: UnwrapRef<typeof import('naive-ui')['NEllipsis']>
readonly NEmpty: UnwrapRef<typeof import('naive-ui')['NEmpty']>
readonly NEquation: UnwrapRef<typeof import('naive-ui')['NEquation']>
readonly NFlex: UnwrapRef<typeof import('naive-ui')['NFlex']>
readonly NFloatButton: UnwrapRef<typeof import('naive-ui')['NFloatButton']>
readonly NFloatButtonGroup: UnwrapRef<typeof import('naive-ui')['NFloatButtonGroup']>
readonly NForm: UnwrapRef<typeof import('naive-ui')['NForm']>
readonly NFormItem: UnwrapRef<typeof import('naive-ui')['NFormItem']>
readonly NFormItemCol: UnwrapRef<typeof import('naive-ui')['NFormItemCol']>
readonly NFormItemGi: UnwrapRef<typeof import('naive-ui')['NFormItemGi']>
readonly NFormItemGridItem: UnwrapRef<typeof import('naive-ui')['NFormItemGridItem']>
readonly NFormItemRow: UnwrapRef<typeof import('naive-ui')['NFormItemRow']>
readonly NGi: UnwrapRef<typeof import('naive-ui')['NGi']>
readonly NGlobalStyle: UnwrapRef<typeof import('naive-ui')['NGlobalStyle']>
readonly NGradientText: UnwrapRef<typeof import('naive-ui')['NGradientText']>
readonly NGrid: UnwrapRef<typeof import('naive-ui')['NGrid']>
readonly NGridItem: UnwrapRef<typeof import('naive-ui')['NGridItem']>
readonly NH1: UnwrapRef<typeof import('naive-ui')['NH1']>
readonly NH2: UnwrapRef<typeof import('naive-ui')['NH2']>
readonly NH3: UnwrapRef<typeof import('naive-ui')['NH3']>
readonly NH4: UnwrapRef<typeof import('naive-ui')['NH4']>
readonly NH5: UnwrapRef<typeof import('naive-ui')['NH5']>
readonly NH6: UnwrapRef<typeof import('naive-ui')['NH6']>
readonly NHeatmap: UnwrapRef<typeof import('naive-ui')['NHeatmap']>
readonly NHighlight: UnwrapRef<typeof import('naive-ui')['NHighlight']>
readonly NHr: UnwrapRef<typeof import('naive-ui')['NHr']>
readonly NIcon: UnwrapRef<typeof import('naive-ui')['NIcon']>
readonly NIconWrapper: UnwrapRef<typeof import('naive-ui')['NIconWrapper']>
readonly NImage: UnwrapRef<typeof import('naive-ui')['NImage']>
readonly NImageGroup: UnwrapRef<typeof import('naive-ui')['NImageGroup']>
readonly NImagePreview: UnwrapRef<typeof import('naive-ui')['NImagePreview']>
readonly NInfiniteScroll: UnwrapRef<typeof import('naive-ui')['NInfiniteScroll']>
readonly NInput: UnwrapRef<typeof import('naive-ui')['NInput']>
readonly NInputGroup: UnwrapRef<typeof import('naive-ui')['NInputGroup']>
readonly NInputGroupLabel: UnwrapRef<typeof import('naive-ui')['NInputGroupLabel']>
readonly NInputNumber: UnwrapRef<typeof import('naive-ui')['NInputNumber']>
readonly NInputOtp: UnwrapRef<typeof import('naive-ui')['NInputOtp']>
readonly NLayout: UnwrapRef<typeof import('naive-ui')['NLayout']>
readonly NLayoutContent: UnwrapRef<typeof import('naive-ui')['NLayoutContent']>
readonly NLayoutFooter: UnwrapRef<typeof import('naive-ui')['NLayoutFooter']>
readonly NLayoutHeader: UnwrapRef<typeof import('naive-ui')['NLayoutHeader']>
readonly NLayoutSider: UnwrapRef<typeof import('naive-ui')['NLayoutSider']>
readonly NLegacyTransfer: UnwrapRef<typeof import('naive-ui')['NLegacyTransfer']>
readonly NLi: UnwrapRef<typeof import('naive-ui')['NLi']>
readonly NList: UnwrapRef<typeof import('naive-ui')['NList']>
readonly NListItem: UnwrapRef<typeof import('naive-ui')['NListItem']>
readonly NLoadingBarProvider: UnwrapRef<typeof import('naive-ui')['NLoadingBarProvider']>
readonly NLog: UnwrapRef<typeof import('naive-ui')['NLog']>
readonly NMarquee: UnwrapRef<typeof import('naive-ui')['NMarquee']>
readonly NMention: UnwrapRef<typeof import('naive-ui')['NMention']>
readonly NMenu: UnwrapRef<typeof import('naive-ui')['NMenu']>
readonly NMessageProvider: UnwrapRef<typeof import('naive-ui')['NMessageProvider']>
readonly NModal: UnwrapRef<typeof import('naive-ui')['NModal']>
readonly NModalProvider: UnwrapRef<typeof import('naive-ui')['NModalProvider']>
readonly NNotificationProvider: UnwrapRef<typeof import('naive-ui')['NNotificationProvider']>
readonly NNumberAnimation: UnwrapRef<typeof import('naive-ui')['NNumberAnimation']>
readonly NOl: UnwrapRef<typeof import('naive-ui')['NOl']>
readonly NP: UnwrapRef<typeof import('naive-ui')['NP']>
readonly NPageHeader: UnwrapRef<typeof import('naive-ui')['NPageHeader']>
readonly NPagination: UnwrapRef<typeof import('naive-ui')['NPagination']>
readonly NPerformantEllipsis: UnwrapRef<typeof import('naive-ui')['NPerformantEllipsis']>
readonly NPopconfirm: UnwrapRef<typeof import('naive-ui')['NPopconfirm']>
readonly NPopover: UnwrapRef<typeof import('naive-ui')['NPopover']>
readonly NPopselect: UnwrapRef<typeof import('naive-ui')['NPopselect']>
readonly NProgress: UnwrapRef<typeof import('naive-ui')['NProgress']>
readonly NQrCode: UnwrapRef<typeof import('naive-ui')['NQrCode']>
readonly NRadio: UnwrapRef<typeof import('naive-ui')['NRadio']>
readonly NRadioButton: UnwrapRef<typeof import('naive-ui')['NRadioButton']>
readonly NRadioGroup: UnwrapRef<typeof import('naive-ui')['NRadioGroup']>
readonly NRate: UnwrapRef<typeof import('naive-ui')['NRate']>
readonly NResult: UnwrapRef<typeof import('naive-ui')['NResult']>
readonly NRow: UnwrapRef<typeof import('naive-ui')['NRow']>
readonly NScrollbar: UnwrapRef<typeof import('naive-ui')['NScrollbar']>
readonly NSelect: UnwrapRef<typeof import('naive-ui')['NSelect']>
readonly NSkeleton: UnwrapRef<typeof import('naive-ui')['NSkeleton']>
readonly NSlider: UnwrapRef<typeof import('naive-ui')['NSlider']>
readonly NSpace: UnwrapRef<typeof import('naive-ui')['NSpace']>
readonly NSpin: UnwrapRef<typeof import('naive-ui')['NSpin']>
readonly NSplit: UnwrapRef<typeof import('naive-ui')['NSplit']>
readonly NStatistic: UnwrapRef<typeof import('naive-ui')['NStatistic']>
readonly NStep: UnwrapRef<typeof import('naive-ui')['NStep']>
readonly NSteps: UnwrapRef<typeof import('naive-ui')['NSteps']>
readonly NSwitch: UnwrapRef<typeof import('naive-ui')['NSwitch']>
readonly NTab: UnwrapRef<typeof import('naive-ui')['NTab']>
readonly NTabPane: UnwrapRef<typeof import('naive-ui')['NTabPane']>
readonly NTable: UnwrapRef<typeof import('naive-ui')['NTable']>
readonly NTabs: UnwrapRef<typeof import('naive-ui')['NTabs']>
readonly NTag: UnwrapRef<typeof import('naive-ui')['NTag']>
readonly NTbody: UnwrapRef<typeof import('naive-ui')['NTbody']>
readonly NTd: UnwrapRef<typeof import('naive-ui')['NTd']>
readonly NText: UnwrapRef<typeof import('naive-ui')['NText']>
readonly NTh: UnwrapRef<typeof import('naive-ui')['NTh']>
readonly NThead: UnwrapRef<typeof import('naive-ui')['NThead']>
readonly NThing: UnwrapRef<typeof import('naive-ui')['NThing']>
readonly NTime: UnwrapRef<typeof import('naive-ui')['NTime']>
readonly NTimePicker: UnwrapRef<typeof import('naive-ui')['NTimePicker']>
readonly NTimeline: UnwrapRef<typeof import('naive-ui')['NTimeline']>
readonly NTimelineItem: UnwrapRef<typeof import('naive-ui')['NTimelineItem']>
readonly NTooltip: UnwrapRef<typeof import('naive-ui')['NTooltip']>
readonly NTr: UnwrapRef<typeof import('naive-ui')['NTr']>
readonly NTransfer: UnwrapRef<typeof import('naive-ui')['NTransfer']>
readonly NTree: UnwrapRef<typeof import('naive-ui')['NTree']>
readonly NTreeSelect: UnwrapRef<typeof import('naive-ui')['NTreeSelect']>
readonly NUl: UnwrapRef<typeof import('naive-ui')['NUl']>
readonly NUpload: UnwrapRef<typeof import('naive-ui')['NUpload']>
readonly NUploadDragger: UnwrapRef<typeof import('naive-ui')['NUploadDragger']>
readonly NUploadFileList: UnwrapRef<typeof import('naive-ui')['NUploadFileList']>
readonly NUploadTrigger: UnwrapRef<typeof import('naive-ui')['NUploadTrigger']>
readonly NVirtualList: UnwrapRef<typeof import('naive-ui')['NVirtualList']>
readonly NWatermark: UnwrapRef<typeof import('naive-ui')['NWatermark']>
readonly acceptHMRUpdate: UnwrapRef<typeof import('pinia')['acceptHMRUpdate']>
readonly arrayToTree: UnwrapRef<typeof import('utils4u/array')['arrayToTree']>
readonly asyncComputed: UnwrapRef<typeof import('@vueuse/core')['asyncComputed']>

View File

@@ -5,13 +5,7 @@ import hljs from 'highlight.js/lib/core';
import json from 'highlight.js/lib/languages/json';
hljs.registerLanguage('json', json);
definePage({
meta: {
link: true,
title: 'Functional Component Demo',
},
});
definePage({ meta: { link: true } });
const FComponent: FunctionalComponent<{ prop: string }> = (props /* context */) => (
<>
<NBlockquote>

View File

@@ -22,7 +22,38 @@ import IconsResolver from 'unplugin-icons/resolver';
import { VantResolver } from '@vant/auto-import-resolver';
// <<<<<
export async function loadPlugin(_configEnv: ConfigEnv): Promise<PluginOption> {
import fs from 'node:fs';
import path from 'node:path';
function _getNaiveUiComponentNames() {
// 方法1: 从 web-types.json 读取(推荐)
const webTypesPath = path.resolve('node_modules/naive-ui/web-types.json');
if (fs.existsSync(webTypesPath)) {
const webTypes = JSON.parse(fs.readFileSync(webTypesPath, 'utf-8'));
const components = webTypes.contributions.html['vue-components'];
const componentNames = components.map((component: { name: string }) => component.name);
console.log('naive-ui components count (from web-types.json):', componentNames.length);
return componentNames;
}
// 方法2: 从 volar.d.ts 读取(备选)
const volarPath = path.resolve('node_modules/naive-ui/volar.d.ts');
if (fs.existsSync(volarPath)) {
const volarContent = fs.readFileSync(volarPath, 'utf-8');
// 匹配类似 "NAffix: (typeof import('naive-ui'))['NAffix']" 的行
const regex = /^\s+(N\w+):/gm;
const matches = [...volarContent.matchAll(regex)];
const componentNames = matches.map((match) => match[1]);
console.log('naive-ui components count (from volar.d.ts):', componentNames.length);
return componentNames;
}
console.warn('Could not find naive-ui component metadata files');
return [];
}
export function loadPlugin(_configEnv: ConfigEnv): PluginOption {
return [
// https://github.com/antfu/unplugin-auto-import
AutoImport({
@@ -43,7 +74,14 @@ export async function loadPlugin(_configEnv: ConfigEnv): Promise<PluginOption> {
{
'consola/browser': ['consola'],
'vue-router/auto': ['useLink'],
'naive-ui': ['useModal', 'useDialog', 'useMessage', 'useNotification', 'useLoadingBar'],
'naive-ui': [
'useModal',
'useDialog',
'useMessage',
'useNotification',
'useLoadingBar',
..._getNaiveUiComponentNames(),
],
},
],
vueTemplate: true,
@@ -53,7 +91,7 @@ export async function loadPlugin(_configEnv: ConfigEnv): Promise<PluginOption> {
// `__`开头的
excludeNames: [/^__/],
// allow auto load markdown components under `./src/components/`
extensions: ['vue', 'md'],
extensions: ['vue', 'md', 'tsx'],
// allow auto import and register components used in markdown
include: [/\.vue$/, /\.vue\?vue/, /\.md$/],
resolvers: [

View File

@@ -41,7 +41,7 @@ async function loadPlugins(configEnv: ConfigEnv): Promise<PluginOption[]> {
// 优先使用 loadPlugin 函数(接收 configEnv 参数)
if (loadPlugin && typeof loadPlugin === 'function') {
const result = await loadPlugin(configEnv);
const result = loadPlugin(configEnv);
plugin = result;
loadMethod = 'loadPlugin';
} else if (imported.default) {