【发布时间】:2017-09-13 07:32:18
【问题描述】:
这是 Vue.js 模板
<strong>{{userdata.phone}}</strong>
当 userdata.phone == null 或 userdata.phone == undefined 时,我想显示空间。 例如
<strong> {{ userdata.phone | !null | !undefined }} </strong>
有可能吗? 在这种情况下怎么做?
<strong>{{userdata.location.city + userdata.location.state + userdata.location.country }}</strong>
userdata.locationi.city,state,country 可以为空或未定义
【问题讨论】:
-
您想显示城市、州和县还是哪个可用?
标签: javascript templates vue.js null undefined