HTML部分代码如下:
<span class="${this.getCurrency(amount)}">${amount)} 拾 </span>
JS部分代码如下:
getCurrency(s) {
if (s === undefined || '') {
return 'hidden'
} else {
return 'show'
}
},
CSS部分代码如下:
.show{display: inline;}
.hidden{display: none;}
最终效果如图所示: