-
-
Notifications
You must be signed in to change notification settings - Fork 378
Closed
Description
请问下components.d.ts
里包含了所有涉及自动导入的组件吗?我想写个脚本,根据components.d.ts这个清单,对所有自动导入的组件做其他处理;
这是我的插件配置:
import UnpluginVueComponents from 'unplugin-vue-components/rspack';
...
plugins: [
UnpluginVueComponents({
directoryAsNamespace: true,
dts: true,
})
这是我的components.d.ts:
declare module 'vue' {
export interface GlobalComponents {
AsyncDialogMain: typeof import('./src/components/async-dialog/main.vue')['default']
BindPolicyCaptchaLevelSelect: typeof import('./src/components/bind-policy/captcha-level-select.vue')['default']
}
}
我理解插件的默认配置下,会扫描所有.vue的<template>
内容,并根据components.d.ts
中GlobalComponents
的key
为组件名,去匹配<AsyncDialogMain>/<BindPolicyCaptchaLevelSelect>
这些组件写法,然后自动import对应的组件路径
Metadata
Metadata
Assignees
Labels
No labels