Open Yxiuchao opened 2 years ago
The resolver is not correct. https://github.com/antfu/unplugin-vue-components/blob/c1ffcd665d283ecb0c2453ac5c8ad7affb73b09e/src/types.ts#L30-L32
if you ref to the type
ComponentInfo
should be
{
as?: string
name?: string
from: string
sideEffects?: SideEffectsInfo
}
So I think you should return
(name) => {
if (name.startsWith('Pro')) {
const fileName = name.slice(3).replace(/\B([A-Z])/g, '-$1').toLocaleLowerCase()
return {
name,
from: 'element-pro-components', //define is not in lib
sideEffects: `element-pro-components/lib/styles/${fileName}`,
}
}
},
Describe the bug
在vue文件中通过给script设置setup后组件可以使用,但是在无法解析到
组件模板:
vue.config.js配置方式
无法解析到引用的组件
Reproduction
none
System Info
Used Package Manager
yarn
Validations