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

Vue.install报错 #75

Closed
waycowei opened this issue Dec 24, 2020 · 6 comments
Closed

Vue.install报错 #75

waycowei opened this issue Dec 24, 2020 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@waycowei
Copy link

https://github.com/bytedance/IconPark/blob/master/packages/vue/README.md#install

Vue全局安装文档中
image
Vue实例好像没有install函数?

@waycowei
Copy link
Author

终于全局安装完了,文档坑挺多

一我盲猜是Vue.comonent不是Vue.install
二是@icon-park/vue 导出了图标和一个默认配置,Vue.component的时候需要注意下
三是图标导出的组件名并不是图标名,而是 icon+图标名,比如说<icon-home />

Object.values(icons).forEach(icon => {
  icon.name && Vue.component(icon.name, icon)
})

@waycowei
Copy link
Author

建议吧,可以用 Vue.use 全局安装。。。。

@waycowei
Copy link
Author

https://github.com/ElemeFE/element/blob/dev/src/index.js

参考一下这里,提供一下install函数就行了 = =

@AppleMonkey2019
Copy link
Member

感谢反馈,可以提一个PR(^o^)/~

@waycowei
Copy link
Author

最近比较忙,周末我看看

@AppleMonkey2019
Copy link
Member

试试@icon-park/vue@1.1.5,这里补充了例子:https://github.com/IconPark/demos/blob/master/vue2-icon-demos/src/App.vue

@AppleMonkey2019 AppleMonkey2019 self-assigned this Dec 26, 2020
@AppleMonkey2019 AppleMonkey2019 added the bug Something isn't working label Dec 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants