600字范文,内容丰富有趣,生活中的好帮手!
600字范文 > ant design分享记录-icon图标自定义菜单图标

ant design分享记录-icon图标自定义菜单图标

时间:2022-02-18 00:59:16

相关推荐

ant design分享记录-icon图标自定义菜单图标

ant design分享-icon图标自定义菜单图标

本过程使用 上的

设置icon前缀

import {Icon } from 'ant-design-vue';import Vue from 'vue'const JihaoIcon = Icon.createFromIconfontCN({scriptUrl:'///t/xxxxxxxxxxxxxxxx.js'})ponent('jihao-icon', JihaoIcon)export default JihaoIcon

在src/components/Menu/menu.js里

修改菜单图标

renderIcon (icon) {if (icon === 'none' || icon === undefined) {return null}const props = {}typeof (icon) === 'object' ? ponent = icon : props.type = iconif (props.type && props.type.startsWith('icon_')) {return (<JihaoIcon type={props.type}/>)}return (<Icon {... {props } }/>)},

其他地方图标添加方式

<a-button @click="handleRemove(record)" style="padding: 0 6px;font-size: 12px;height: 26px;"><jihao-icon style="font-size: 13px;" title="删除" type="icon_delete_device"></jihao-icon><span style="font-size: 12px;">删除</span></a-button>

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。