热门

最新

红包

立Flag

投票

同城

我的

发布
weixin_53051713
油麦菜你好
3 年前
trueweixin_53051713

p21- 统计、清空Clear、隐藏
隐藏:没有数据时,隐藏元素(intems left 和 Clear)(v-show v-if 数据非空)
<body>
<!--列表区域-->
<ul>
<ol class="input_text color" v-for="(item,index) in arr">{{index+1}}.{{item}}
<button type="button" class="destroy" @click="remove(index)">×</button> <!--删除键-->
</ol>
</ul>
<div class="footer" v-show="arr.length!=0">
<span class="todo-count" v-if="arr.length!=0">
<strong>{{arr.length}} items left</strong> <!--统计-->
</span>

<!--<div @click="clear" class="pointer">Clear</div> -->
<botton v-show="arr.length!=0" class="clear-completed" @click="clear"> Clear </botton>
</div>
<hr >
</div> <script>....</script></body>

CSDN App 扫码分享
分享
评论
3
打赏
  • 复制链接
  • 举报
下一条:
不看不知道,一看吓一跳. 居然注册十年了
立即登录