Closed yellow13441 closed 3 years ago
I'm a noob of front-end framework and just want to figure out it's my issue only or @ant-design/icons-vue does not support vue3 yet.
It turns out icons work well if I import and use it in one single component instead of use it in main.js with 'app.use(UploadOutlined)'
code like below works: upload.vue
<template>
<a-button>
<upload-outlined></upload-outlined>
Click to Upload
</a-button>
</template>
<script>
import { UploadOutlined } from '@ant-design/icons-vue';
export default {
components: {
UploadOutlined,
},
}
</script>
Forgive my ignorance :smile:
To answer my own question,
I'm a noob of front-end framework and just want to figure out it's my issue only or @ant-design/icons-vue does not support vue3 yet.
@ant-design/icons-vue works just fine in vue3
I built my vue project with vue/cli(version: @vue/cli 4.5.11) with vue3 default config, and installed both ant-design-vue@next and @ant-design/icons-vue with npm. When I try to use an icon such as UserOutlined or StarOutlined in my main.js with code below:
The brower throws a warn as below with nothing rendering in the page.
No message from the console side BTW.
main.js
package.json