亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

vue.js 的 v-for列表渲染問題

vue.js 的 v-for列表渲染問題

暴躁的代碼 2017-06-13 11:04:31
<tbody?id="show-blog-type-module"?onclick="return?clickTr(event)"?> <tr?v-for="(blogType,index)?in?blogTypes"> <td>{{index++}}</td> <td>{{blogType.id}}</td> <td>{{blogType.name}}</td> <td>{{blogType.detail}}</td> <td>{{blogType.blogs.length}} <a?class="pointer"?v-on:click="showBlogs"> <span?class="glyphicon?glyphicon-resize-full"></span> </a> </td> <td> <a?class="pointer"> <span?class="glyphicon?glyphicon-edit"??title="編輯"></span> </a> </td> <td> <a?:href="'manager/blogType/delete?id='+blogType.id"> <span?class="glyphicon?glyphicon-trash"?title="刪除"></span> </a> </td> <td> <a?:href="'blog/type?id='+blogType.id"> <span?class="glyphicon?glyphicon-link"?title="瀏覽"></span> </a> </td> </tr>? ?? </tbody>我想在這個循環的tr中做一個手風琴的效果,如果想在表格中用v-for一次渲染兩列<xxx?v-for="(blogType,index)?in?blogTypes"> ????<tr></tr> ????<tr></tr> </xxx>但是這樣會vue報錯 v-for 不會渲染應為瀏覽器識別不了xxx標簽。敢問各位大俠有什么好方法嗎?
查看完整描述

1 回答

已采納
?
woshiajuana

TA貢獻211條經驗 獲得超152個贊

使用template標簽看看

<template?v-for="(blogType,index)?in?blogTypes">
????<tr></tr>
????<tr></tr>
</template>


查看完整回答
2 反對 回復 2017-06-13
  • 1 回答
  • 0 關注
  • 3139 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號