vue的核心功能是for循环,双层for循环的场景也是比较常见。

<script type="text/javascript">
var vm = new Vue({
el: "#ex",
data: {
data: [
{ "Name": "马良1", "Items": [{ "Score": 810 }, { "Score": 80 }, { "Score": 80 }] },
{ "Name": "马良2", "Items": [{ "Score": 80 }, { "Score": 80 }, { "Score": 80 }] },
{ "Name": "马良3", "Items": [{ "Score": 80 }, { "Score": 80 }, { "Score": 80 }] },
{ "Name": "马良4", "Items": [{ "Score": 80 }] }
]
},
methods: {
woca: function () {
alert("卧槽")
},
fuck: function () {
this.data = [{ "Name": "马良1", "Items": [{ "Score": 810 }, { "Score": 80 }, { "Score": 80 }, { "Score": 810 }, { "Score": 80 }, { "Score": 80 }, { "Score": 810 }, { "Score": 80 }, { "Score": 80 }, { "Score": 810 }, { "Score": 80 }, { "Score": 80 }, { "Score": 810 }, { "Score": 80 }, { "Score": 80 }, { "Score": 810 }, { "Score": 80 }, { "Score": 80 }] }];
}
}
});
$('#Button1').click(function () {
vm.fuck();
});
</script>

HTML代码

   <div class="btn-group btn-group-md" role="group"  style="margin:10px;">
<button type="button" id="Button1" class="btn btn-default">Left</button>
<button type="button" class="btn btn-default">Middle</button>
<button type="button" class="btn btn-default">Right</button>
</div>
<div class="row" id="ex">
<div class="col-md-4" v-for="item in data">
<div class="panel panel-default">
<div class="panel-heading">{{item.Name}}</div>
<div class="panel-body" style="max-height: 289px;overflow: auto;">
<div class="col-md-4" v-for="item1 in item.Items">
<div style="min-height:100px;border:1px solid #eee;margin-top:10px;line-height: 100px;text-align: center;font-size: 25px;border-radius: 15px;">
{{item1.Score}}
</div>
<div class="btn-group btn-group-xs" role="group" style="margin:10px;">
<button type="button" class="btn btn-primary">编辑</button><button type="button" class="btn btn-danger">删除</button>
</div>
</div>
</div>
</div>
</div>
</div>
v-for="item in data"
v-for="item1 in item.Items"

关于Vue的两层for循环的更多相关文章

  1. java中怎么跳出两层for循环

    使用标号(使用标号跳出两层或者多层for循环): outterLoop: for (int i = 0; i < 9; i++){             for (int j = 0; j & ...

  2. 小程序:怎么在两层列表循环(wx:for)的时候判断是否为最后一个元素

    问题说明: 如下图所示,在箭头所指的最后一个选项的底线与底部操作栏的上边线重叠,需要清除掉最后一个元素的底线: 想到的解决方案:  通过判断是否为最后一个元素,然后通过条件渲染(wx:if)动态添加对 ...

  3. 例题:打印正三角形。两层for循环,难点明白行与列的关系

    while (true)            {                string s = "★";//s代表五角星                string t = ...

  4. [转]oracle分页用两层循环还是三层循环?

    select t2.* from --两层嵌套 (select t.* , rownum as row_numfrom t where rownum <=20) t2 where t2.row_ ...

  5. Linux网络栈下两层实现

    http://www.cnblogs.com/zmkeil/archive/2013/04/18/3029339.html 1.1简介 VLAN是网络栈的一个附加功能,且位于下两层.首先来学习Linu ...

  6. C#中巧用妙法避免嵌套方式使用两个foreach循环

    问题:需要对DataGridViewRow的下拉框列Item2所选内容进行判断,看是否跟数据库里面某个配置表的数据列Item1匹配.如果用两个foreach循环进行匹配,会导致逻辑复杂而且容易只bre ...

  7. Deep Learning入门视频(上)_一层/两层神经网络code

    关于在51CTO上的深度学习入门课程视频(9)中的code进行解释与总结: (1)单层神经网络: #coding:cp936 #建立单层神经网络,训练四个样本, import numpy as np ...

  8. MYSQL注入天书之服务器(两层)架构

    Background-6 服务器(两层)架构 首先介绍一下29,30,31这三关的基本情况: 服务器端有两个部分:第一部分为tomcat为引擎的jsp型服务器,第二部分为apache为引擎的php服务 ...

  9. 咏南中间件支持DELPHI低版本开发的两层程序平稳升级到三层

    提供DELPHI中间件及中间件集群,有意请联系. N年前,我们用DELPHI低版本开发的两层程序(比如工厂ERP系统),现在仍然在企业广泛地得到使用,但老系统有些跟不上企业的发展需要了.主要表现在:虽 ...

随机推荐

  1. saltstack syndic

    #syndic 相当于master的代理,master通过syndic代理控制node主机 master <------ syndic+master <---------- node ma ...

  2. Bootstrap框架介绍

    Bootstrap框架介绍 一.Bootstarp环境部署 1>.什么是Bootstartp框架 Bootstrap是Twitter开源的基于HTML.CSS.JavaScript的前端框架.它 ...

  3. Jvm threaddump,heapdump的分析及问题定位

    1 一.Thread Dump介绍 1.1 1.1什么是Thread Dump? 1.2 1.2 Thread Dump特点 1.3 1.3 Thread Dump 能诊断的问题 1.4 1.4如何抓 ...

  4. python django基础二URL路由系统

    URL配置 基本格式 from django.conf.urls import url #循环urlpatterns,找到对应的函数执行,匹配上一个路径就找到对应的函数执行,就不再往下循环了,并给函数 ...

  5. python mysql 视图 触发器 事物 存储过程 用户授权 数据备份还原

    ###################总结########### 视图是一个虚拟表(非真实存在) 是跑在内存中的表,真实表是在硬盘上的表 使用视图我们可以把查询过程中的临时表摘出来,保存下来,用视图去 ...

  6. jQuery获取相同元素下标

    如题:经常搞混淆,index()获取的是下标,而eq(下标值)获取的是元素对象 var list=$(".toos");//获取class为toos的元素集合$('.toos'). ...

  7. MySQL中innodb_flush_log_at_trx_commit的设置

    innodb_flush_log_at_trx_commit=0,在提交事务时,InnoDB不会立即触发将缓存日志写到磁盘文件的操作,而是每秒触发一次缓存日志回写磁盘操作,并调用操作系统fsync刷新 ...

  8. Part-Ten

    1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12.

  9. 简单备份mysql数据库

    对于数据量不大的业务场景,可以每天做全量备份. 实现方式:编写备份数据库脚本,然后在crontab中每天定时执行脚本进行备份. 备份脚本示例: #!/bin/bash #Author: zhangsa ...

  10. mvn打包时添加日期参数

    maven打包时想添加日期参数,如:将"xxx.jar"打包为"xxx-yyyyMMdd.jar"这样的格式.如何实现? 自Maven 2.1.0-M1版本之后 ...