0
点赞
收藏
分享

微信扫一扫

vue 复选框的渲染

水墨_青花 2022-07-12 阅读 54


vue 复选框的渲染_Vue

这个是我想要的结果,但是却一直没有渲染出来

<div class="tab-pane viewlist">
<div class="box box-solid" style="box-shadow: none;">
<div class="box-body">
<ol>
<li v-for="(item,index) in data">
<input type="checkbox" v-bind:checked=item.root.checkstatus /> <span>{{item.root.name}}</span>
<ol v-if="item.havesub=='1'">
<li v-for="(sub,k) in item.subs">
<input type="checkbox" v-bind:checked=sub.checkstatus />{{sub.name}}</li>
</ol>
</li>
</ol>
</div>
</div>
</div>

关键在于什么 

<input type="checkbox" v-bind:checked=sub.checkstatus/>{{sub.name}}</li>

这个地方哪里出现错误

居然在input的标签的结束/上面,这样写就对了

<input type="checkbox" v-bind:checked=sub.checkstatus />{{sub.name}}</li>

平时没有注意这些细节

vue 复选框的渲染_Vue_02

关键是这个位置有一个空格

希望对你有所帮助 

举报

相关推荐

0 条评论