如何用vue的UI库-element-plus里面的icon?
安装icons-vue
npm install @element-plus/icons-vue
在main.ts中引入
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
const app = createApp(App)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
app.component(key, component)
}
app.mount('#app')
使用示例
<el-button circle @click="toggleSidebar">
<el-icon>
<Close />
</el-icon>
</el-button>