Vue.filter(‘ranks’, function (v) {
let result = ‘’;
switch (v) {
case ‘0’: result = ‘一级’;break;
case ‘1’: result = ‘二级’;break;
case ‘2’: result = ‘三级’; break;
default: result = ‘没有要满足的级别’;
}
return result
})
Vue.filter(‘ranks’, function (v) {
let result = ‘’;
switch (v) {
case ‘0’: result = ‘一级’;break;
case ‘1’: result = ‘二级’;break;
case ‘2’: result = ‘三级’; break;
default: result = ‘没有要满足的级别’;
}
return result
})