我想在vue.js中使用if-directive来确定每个表行中应该显示哪个数据字段:
<tr v-repeat="model">
<td>@{{ title }}</td>
<td>@{{ publish_date_start }}</td>
<td v-if="model.publish = 1"><span class="fa fa-check"></span></td>
<td v-if="model.publish = 0"><span class="fa fa-remove"></span></td>
<td class="data-list-action"><a href="/admin/news/@{{ id }}/edit" class="btn btn-warning">edit</a></td>
<td class="data-list-action"><a href="#" v-on="click: deleteRequest(id)" class="btn btn-danger">delete</a></td>
</tr>
如果属性的值发布&#39;为1时,必须显示带有检查的数据字段。如果为0,则必须是十字架。
如何比较&#39; model.publish&#39;一个值?
更新:Fiddle
答案 0 :(得分:1)
尝试MERGE dbo.FinalTable AS TARGET
USING dbo.RealTable AS SOURCE ON TARGET.idP = SOURCE.idP AND TARGET.dateP = SOURCE.dateP
WHEN NOT MATCHED THEN
INSERT
(
name
,idp
,datep
)
VALUES
(
SOURCE.name
,SOURCE.idp
,SOURCE.datep
);
:
v-if