You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
562 B
23 lines
562 B
Vue.component('yl-icon', {
|
|
template: '#tpl-icon',
|
|
props: ['icon','drawer','badge','apps','nobg','img'],
|
|
data:function () {
|
|
return {
|
|
icon:{},
|
|
badge:0,
|
|
drawer:false,
|
|
nobg:false,
|
|
img:'',
|
|
}
|
|
},
|
|
methods:{
|
|
badgeText: function (content) {
|
|
//处理badge的提示内容
|
|
if (isNaN(content)) {
|
|
return content;
|
|
} else {
|
|
return content > 99 ? '99+' : parseInt(content);
|
|
}
|
|
},
|
|
}
|
|
});
|