定义
filters: {
convertDurationUnit(unit) {
const unitList = {
d: "天",
m: "个月",
y: "年",
};
return unitList[unit] || unit;
},
},
};
使用
{{ packageInfo.unit | convertDurationUnit }
定义
filters: {
convertDurationUnit(unit) {
const unitList = {
d: "天",
m: "个月",
y: "年",
};
return unitList[unit] || unit;
},
},
};
使用
{{ packageInfo.unit | convertDurationUnit }