【Vue】data.rows与data的区别???

本文介绍了一种使用Vue.js进行列表渲染的方法,并展示了如何在列表项中进行条件判断显示不同内容。通过具体实例,包括按钮操作如查看、修改、权限设置及删除等,详细解释了Vue.js中v-for循环和v-if条件语句的应用。
<ul id="leftMenu" class="sr-leftBot">
<li v-for="item in resourcesList" class="sr-leftBot-li2">
<!--<a href="#">{{item.name}}</a>-->
<a href="#">{{item.name}}</a>
</li>
</ul>

<tr v-for="item in data.rows">
<td>{{$index+1}}</td>
<td style="text-align: center;">{{item.name}}</td>
<td>{{item.role_code}}</td>
<td>{{item.sort_id}}</td>
<td v-if="item.disabled='0'">是</td>
<td v-else>否</td>
<td>
<!--<input type="button" value="查看" @click="viewRole(item.id)">-->
<input type="button" value="修改" @click="updateVisible(item.id)">
<input type="button" value="权限" @click="permitVisible(item.id)">
<input type="button" value="删除" @click="delVisible(item.id)">
</td>
<!-- <td :class="item.disabled? 'horde':'alliance'"></td>-->
</tr>

转载于:https://www.cnblogs.com/CESC4/p/7567290.html

mp.runtime.esm.js?66fd:613 [Vue warn]: Error in render: "TypeError: Cannot read property 'viewCount' of null" (found in pages/live/index.vue)(env: Windows,mp,1.06.2412050; lib: 3.8.3) warn @ mp.runtime.esm.js?66fd:613 Vue.config.errorHandler @ mp.runtime.esm.js?66fd:5810 globalHandleError @ mp.runtime.esm.js?66fd:1882 handleError @ mp.runtime.esm.js?66fd:1851 Vue._render @ mp.runtime.esm.js?66fd:3565 updateComponent @ mp.runtime.esm.js?66fd:5694 get @ mp.runtime.esm.js?66fd:4423 run @ mp.runtime.esm.js?66fd:4498 flushSchedulerQueue @ mp.runtime.esm.js?66fd:4254 (anonymous) @ mp.runtime.esm.js?66fd:1988 flushCallbacks @ mp.runtime.esm.js?66fd:1916 Promise.then (async) timerFunc @ mp.runtime.esm.js?66fd:1943 nextTick @ mp.runtime.esm.js?66fd:1998 queueWatcher @ mp.runtime.esm.js?66fd:4346 update @ mp.runtime.esm.js?66fd:4488 notify @ mp.runtime.esm.js?66fd:733 reactiveSetter @ mp.runtime.esm.js?66fd:1067 proxySetter @ mp.runtime.esm.js?66fd:4575 switchTab @ index.vue:208 (anonymous) @ index.js?543d:1131 (anonymous) @ index.js?543d:1098 handleEvent @ index.js?543d:1088 mp.runtime.esm.js?66fd:5811 TypeError: Cannot read property 'viewCount' of null at Proxy.render (index.vue?1ea0:6) at VueComponent.Vue._render (mp.runtime.esm.js?66fd:3563) at VueComponent.updateComponent (mp.runtime.esm.js?66fd:5694) at Watcher.get (mp.runtime.esm.js?66fd:4423) at Watcher.run (mp.runtime.esm.js?66fd:4498) at flushSchedulerQueue (mp.runtime.esm.js?66fd:4254) at Array.<anonymous> (mp.runtime.esm.js?66fd:1988) at flushCallbacks (mp.runtime.esm.js?66fd:1916)(env: Windows,mp,1.06.2412050; lib: 3.8.3) Vue.config.errorHandler @ mp.runtime.esm.js?66fd:5811 globalHandleError @ mp.runtime.esm.js?66fd:1882 handleError @ mp.runtime.esm.js?66fd:1851 Vue._render @ mp.runtime.esm.js?66fd:3565 updateComponent @ mp.runtime.esm.js?66fd:5694 get @ mp.runtime.esm.js?66fd:4423 run @ mp.runtime.esm.js?66fd:4498 flushSchedulerQueue @ mp.runtime.esm.js?66fd:4254 (anonymous) @ mp.runtime.esm.js?66fd:1988 flushCallbacks @ mp.runtime.esm.js?66fd:1916 Promise.then (async) timerFunc @ mp.runtime.esm.js?66fd:1943 nextTick @ mp.runtime.esm.js?66fd:1998 queueWatcher @ mp.runtime.esm.js?66fd:4346 update @ mp.runtime.esm.js?66fd:4488 notify @ mp.runtime.esm.js?66fd:733 reactiveSetter @ mp.runtime.esm.js?66fd:1067 proxySetter @ mp.runtime.esm.js?66fd:4575 switchTab @ index.vue:208 (anonymous) @ index.js?543d:1131 (anonymous) @ index.js?543d:1098 handleEvent @ index.js?543d:1088 mp.runtime.esm.js?66fd:613 [Vue warn]: Error in render: "TypeError: Cannot read property 'viewCount' of null" (found in pages/live/index.vue)(env: Windows,mp,1.06.2412050; lib: 3.8.3) warn @ mp.runtime.esm.js?66fd:613 Vue.config.errorHandler @ mp.runtime.esm.js?66fd:5810 globalHandleError @ mp.runtime.esm.js?66fd:1882 handleError @ mp.runtime.esm.js?66fd:1851 Vue._render @ mp.runtime.esm.js?66fd:3565 updateComponent @ mp.runtime.esm.js?66fd:5694 get @ mp.runtime.esm.js?66fd:4423 run @ mp.runtime.esm.js?66fd:4498 flushSchedulerQueue @ mp.runtime.esm.js?66fd:4254 (anonymous) @ mp.runtime.esm.js?66fd:1988 flushCallbacks @ mp.runtime.esm.js?66fd:1916 Promise.then (async) timerFunc @ mp.runtime.esm.js?66fd:1943 nextTick @ mp.runtime.esm.js?66fd:1998 queueWatcher @ mp.runtime.esm.js?66fd:4346 update @ mp.runtime.esm.js?66fd:4488 notify @ mp.runtime.esm.js?66fd:733 reactiveSetter @ mp.runtime.esm.js?66fd:1067 proxySetter @ mp.runtime.esm.js?66fd:4575 switchTab @ index.vue:208 (anonymous) @ index.js?543d:1131 (anonymous) @ index.js?543d:1098 handleEvent @ index.js?543d:1088 mp.runtime.esm.js?66fd:5811 TypeError: Cannot read property 'viewCount' of null at Proxy.render (index.vue?1ea0:6) at VueComponent.Vue._render (mp.runtime.esm.js?66fd:3563) at VueComponent.updateComponent (mp.runtime.esm.js?66fd:5694) at Watcher.get (mp.runtime.esm.js?66fd:4423) at Watcher.run (mp.runtime.esm.js?66fd:4498) at flushSchedulerQueue (mp.runtime.esm.js?66fd:4254) at Array.<anonymous> (mp.runtime.esm.js?66fd:1988) at flushCallbacks (mp.runtime.esm.js?66fd:1916)(env: Windows,mp,1.06.2412050; lib: 3.8.3) Vue.config.errorHandler @ mp.runtime.esm.js?66fd:5811 globalHandleError @ mp.runtime.esm.js?66fd:1882 handleError @ mp.runtime.esm.js?66fd:1851 Vue._render @ mp.runtime.esm.js?66fd:3565 updateComponent @ mp.runtime.esm.js?66fd:5694 get @ mp.runtime.esm.js?66fd:4423 run @ mp.runtime.esm.js?66fd:4498 flushSchedulerQueue @ mp.runtime.esm.js?66fd:4254 (anonymous) @ mp.runtime.esm.js?66fd:1988 flushCallbacks @ mp.runtime.esm.js?66fd:1916 Promise.then (async) timerFunc @ mp.runtime.esm.js?66fd:1943 nextTick @ mp.runtime.esm.js?66fd:1998 queueWatcher @ mp.runtime.esm.js?66fd:4346 update @ mp.runtime.esm.js?66fd:4488 notify @ mp.runtime.esm.js?66fd:733 reactiveSetter @ mp.runtime.esm.js?66fd:1067 proxySetter @ mp.runtime.esm.js?66fd:4575 switchTab @ index.vue:208 (anonymous) @ index.js?543d:1131 (anonymous) @ index.js?543d:1098 handleEvent @ index.js?543d:1088 mp.runtime.esm.js?66fd:613 [Vue warn]: Error in render: "TypeError: Cannot read property 'viewCount' of null" (found in pages/live/index.vue)(env: Windows,mp,1.06.2412050; lib: 3.8.3) warn @ mp.runtime.esm.js?66fd:613 Vue.config.errorHandler @ mp.runtime.esm.js?66fd:5810 globalHandleError @ mp.runtime.esm.js?66fd:1882 handleError @ mp.runtime.esm.js?66fd:1851 Vue._render @ mp.runtime.esm.js?66fd:3565 updateComponent @ mp.runtime.esm.js?66fd:5694 get @ mp.runtime.esm.js?66fd:4423 run @ mp.runtime.esm.js?66fd:4498 flushSchedulerQueue @ mp.runtime.esm.js?66fd:4254 (anonymous) @ mp.runtime.esm.js?66fd:1988 flushCallbacks @ mp.runtime.esm.js?66fd:1916 Promise.then (async) timerFunc @ mp.runtime.esm.js?66fd:1943 nextTick @ mp.runtime.esm.js?66fd:1998 queueWatcher @ mp.runtime.esm.js?66fd:4346 update @ mp.runtime.esm.js?66fd:4488 notify @ mp.runtime.esm.js?66fd:733 reactiveSetter @ mp.runtime.esm.js?66fd:1067 proxySetter @ mp.runtime.esm.js?66fd:4575 switchTab @ index.vue:208 (anonymous) @ index.js?543d:1131 (anonymous) @ index.js?543d:1098 handleEvent @ index.js?543d:1088 mp.runtime.esm.js?66fd:5811 TypeError: Cannot read property 'viewCount' of null at Proxy.render (index.vue?1ea0:6) at VueComponent.Vue._render (mp.runtime.esm.js?66fd:3563) at VueComponent.updateComponent (mp.runtime.esm.js?66fd:5694) at Watcher.get (mp.runtime.esm.js?66fd:4423) at Watcher.run (mp.runtime.esm.js?66fd:4498) at flushSchedulerQueue (mp.runtime.esm.js?66fd:4254) at Array.<anonymous> (mp.runtime.esm.js?66fd:1988) at flushCallbacks (mp.runtime.esm.js?66fd:1916)(env: Windows,mp,1.06.2412050; lib: 3.8.3) Vue.config.errorHandler @ mp.runtime.esm.js?66fd:5811 globalHandleError @ mp.runtime.esm.js?66fd:1882 handleError @ mp.runtime.esm.js?66fd:1851 Vue._render @ mp.runtime.esm.js?66fd:3565 updateComponent @ mp.runtime.esm.js?66fd:5694 get @ mp.runtime.esm.js?66fd:4423 run @ mp.runtime.esm.js?66fd:4498 flushSchedulerQueue @ mp.runtime.esm.js?66fd:4254 (anonymous) @ mp.runtime.esm.js?66fd:1988 flushCallbacks @ mp.runtime.esm.js?66fd:1916 Promise.then (async) timerFunc @ mp.runtime.esm.js?66fd:1943 nextTick @ mp.runtime.esm.js?66fd:1998 queueWatcher @ mp.runtime.esm.js?66fd:4346 update @ mp.runtime.esm.js?66fd:4488 notify @ mp.runtime.esm.js?66fd:733 reactiveSetter @ mp.runtime.esm.js?66fd:1067 proxySetter @ mp.runtime.esm.js?66fd:4575 switchTab @ index.vue:208 (anonymous) @ index.js?543d:1131 (anonymous) @ index.js?543d:1098 handleEvent @ index.js?543d:1088还是报错了改完完整代码
05-11
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值