antdvue2.x 使用阿里iconfont自定义组件iconfont

var style = `.icon {
       width: 1em; height: 1em;
       vertical-align: -0.15em;
       fill: currentColor;
       overflow: hidden;
    }`
myutils.loadStyle(style);
var IconFont = {
    name: 'IconFont',
    props: ['type'],
    template: `<span><svg class="icon" aria-hidden="true"><use :xlink:href="'#'+type"></use></svg></span>`
}

 

posted @ 2021-08-28 16:29  mingruqi  阅读(243)  评论(0编辑  收藏  举报