ant-design v-4.41版本动态引入路由中的icon

第一步

在路由中添加icon 名称

export const adminRoutes = [
    {
        path: "/admin/dashboard",
        component: Index,
        isShow: true,
        title: "看板",
        icon: "AreaChartOutlined"
    },

];

对应的英文名配置在路由中

第二步页面中引入

import  * as Icon from '@ant-design/icons';

第三步循环渲染

这里还可以修改图标的颜色 大小等

加油!!!!!!!!!!!

猜你喜欢

转载自blog.csdn.net/sunnyboysix/article/details/107239490
今日推荐