Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【问题记录】Vue3 + ts 干货👍手把手教你封装一个 SvgIcon 组件 #6

Open
liuhp opened this issue Mar 14, 2024 · 0 comments
Labels
原创 Create by myself

Comments

@liuhp
Copy link
Owner

liuhp commented Mar 14, 2024

1、安装 vite-plugin-svg-icon失败
失败原因:是现有vite版本太低
解决办法:升级vite版本

2、封装组件
image
现象:defineOption会报错,并且无法使用组件
解决办法:删掉这段代码,然后在index.ts注册组件那里从这样:
image

修改成这样:
image

然后就能正常使用组件了。

没有实践:编写自定义 vite 插件,增强 name 字段类型提示 下面的内容。

@liuhp liuhp added the 原创 Create by myself label Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
原创 Create by myself
Projects
None yet
Development

No branches or pull requests

1 participant