Skip to content

请问下components.d.ts里包含了所有涉及自动导入的组件吗? #859

@k644606347

Description

@k644606347

请问下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.tsGlobalComponentskey为组件名,去匹配<AsyncDialogMain>/<BindPolicyCaptchaLevelSelect>这些组件写法,然后自动import对应的组件路径

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy