Use the ternary operator to judge the usage in the template:For example: the following is to set selected according to the data judgment when rendering the page<option value="0" {{ 0==d.iTop?'selected':''}}>Please select the priority</option>
Use the method of loop traversal in the template: (traverse again in the template)Refer here: http://www.layui.com/demo/laytpl.html