我要页面渲染时间,在该选择框值empty string
或undefined
或null
中选择占位符
它只能使用一个值(empty string
)。
但是我想要以上三个值(empty string
或undefined
或null
)
我的猜测需求解决方案是选项中带有Or-symbol的值。
例如:
<option [value]="''||undefined||null" disabled selected>Select Product</option>
但是它不起作用。如果有人知道该解决方案与我共享
答案 0 :(得分:1)
[value]
无法接受逻辑表达式。只需在模型为''
或null
时将值undefined
分配给模型:
this.item.genericByProd = this.item.genericByProd || '';