是的,通过使用
v-if
或v-show
<button v-if="currentTrack.path_15 != null && currentTrack.path_15 != undefined && currentTrack.path_15 != ''" ... >15s</button>
你也可以为此创建一个计算属性:
computed: {
isPath15Empty() {
return this.currentTrack.path_15 == null || this.currentTrack.path_15 == undefined || this.currentTrack.path_15 == '';
}
}
然后
<button v-if="!isPath15Empty" ...