赞
踩
通过iconfont来转化成代码,添加类使用。
把下载的文件存到项目存放icons的文件夹,下面的文件里面有很多小文件,只需要拿.css,.ttf,.woff,.woff2这4个格式的文件就行
import './assets/icons/router-icons/iconfont.css'
- import type { Route } from '../index.type'
- import Layout from '@/layout/index.vue'
- import { createNameComponent } from '../createNode'
- const route: Route[] = [
- {
- path: '/',
- component: Layout,
- redirect: '/home',
- hideMenu: true,
- meta: { title: 'message.menu.dashboard.name', icon: 'iconfont system-home' },
- },
- {
- path: '/home',
- component: Layout,
- redirect: '/home/dashboard',
- meta: { title: 'message.menu.dashboard.name', icon: 'iconfont c-home_a' },
- alwayShow: true,
- children: [
- {
- path: 'dashboard',
- component: createNameComponent(() => import('@/views/main/home/dashboard/index.vue')),
- meta: { title: 'message.menu.dashboard.index', hideClose: true },
- }
- ],
- },
- ]
-
- export default route
也可以在页面i标签中使用
<i class="iconfont c-home_a" />
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。