问题遇到的现象和发生背景
script的类型时text/template,如何让指定元素判断当前值是否为空,决定当前元素是否被渲染
问题相关代码,请勿粘贴截图
<template type="template/text" class="template-table-tr">
<tr>
<td>
<div class="product-content">
<div class="product-thumb">
<img fit="contain" alt="{{item_title}}" title="{{item_title}}" width="64" height="64" src="{{thumbnail}}" />
</div>
<div class="product-info">
<div class="product-info__title">
<a href="{{item_url}}">{{item_title}}</a>
</div>
<!-- 如何判断{{item_variation}}是否不为空,决定下面的div是否存在 -->
<div class="product-info__attrs">
<span>{{item_variation}}</span>
</div>
</div>
</div>
</td>
</tr>
</template>