首先引入@ant-design/icons-vue整个图标库,然后Jsx组件内,通过渲染函数直接渲染指定的图标;基础代码如下: 代码语言:javascript 复制 import{h}from'vue'import*as$iconfrom'@ant-design/icons-vue';/* * 自动引入antd icon图标 * */exportdefault{props:['icon'],setup(props){return()=>h($icon[props.icon...
import { createApp } from 'vue' import App from './App.vue' import router from './router' import store from './store' import Antd from 'ant-design-vue' //导入所有图标库 import * as Icons from "@ant-design/icons-vue"; import type { Component } from 'vue' import 'reset.css/rese...
// main.jsimportVuefrom'vue'importAppfrom'./App.vue'importrouterfrom'./router'importstorefrom'./store'// 新增代码:引入特定组件// 此时会自动引入对应的样式文件,无需再手动逐一引入import{Button}from'ant-design-vue'// 新增代码:注册特定组件Vue.component(Button.name,Button)newVue({ router, store,...
import { createApp } from 'vue' import App from './App.vue' import router from './router' import store from './store' import Antd from 'ant-design-vue' //导入所有图标库 import * as Icons from "@ant-design/icons-vue"; import type { Component } from 'vue' import 'reset.css/rese...