Vue.js:如果值为空,则不渲染属性(例如:to="" 或 type="")

问题描述 投票:0回答:1
javascript vue.js properties vue-component
1个回答
23
投票

使用

v-bind
绑定到
null
undefined
false
值的任何属性都不会在元素中渲染。

属性和 v-bind

© www.soinside.com 2019 - 2024. All rights reserved.