'''
有以下成绩单数据
scores = [
{ name: 'Bob', math: 97, chinese: 89, english: 67 },
{ name: 'Tom', math: 67, chinese: 52, english: 98 },
{ name: 'Jerry', math: 72, chinese: 87, english: 89 },
{ name: 'Ben', math: 92, chinese: 87, english: 59 },
{ name: 'Chan', math: 47, chinese: 85, english: 92 },
]
用table表格标签渲染以上数据,表格第一列是学生总分排名,最后一列是学生总分; '''
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<div id="d1">
<table>
<div>
<thead>
<tr>
<th>No.</th>
<th>name</th>
<th>math</th>
<th>chinese</th>
<th>english</th>
<th>sumScore</th>
</tr>
</thead>
<tbody>
<tr v-for="d in score">
<td></td>
<td>{{ d.name }}</td>
<td>{{ d.math }}</td>
<td>{{ d.chinese }}</td>
<td>{{ d.english }}</td>
<td>{{ d.ttlScore }}</td> </tr>
</tbody>
</div> </table>
</div>
</body>
<script src="js/vue.js"></script>
<script>
new Vue({
el: '#d1',
data: {
scores:[
{ name:'Bob',math:'97',chinese:'89',english:'67'},
{ name:'Tom',math:'67',chinese:'52',english:'98'},
{ name:'Jerry',math:'72',chinese:'87',english:'89'},
{ name:'Chan',math:'47',chinese:'85',english:'92'}
] },
filter: {
sumScore(s1,s2,s3) {
return s1 + s2 + s3
}
},
computed: {
score() {
let scoreArr = this.scores;
for (let i = 0; i < scoreArr.length - 1; i++) {
for (let j = 0; j < scoreArr - 1 - i; j++) { let currentScore = scoreArr[j].math + scoreArr[j].chinese + scoreArr[j].english;
let nextScore = scoreArr[j + 1].math + scoreArr[j + 1].chinese + scoreArr[j + 1].english;
scoreArr[j].ttlScore = currentScore;
scoreArr[j + 1].ttlScore = nextScore; if (currentScore < nextScore) {
let temp = scoreArr[j];
scoreArr[j] = scoreArr[j + 1];
scoreArr[j + 1] = temp;
}
}
}
console.log(scoreArr);
return scoreArr
}
}
}); </script>
</html>

day 68 作业的更多相关文章

  1. C 语言学习 第12次作业总结

    作业总结 本次课堂的内容为字符串相关的几个函数还有结构体. 字符串相关函数 在此之前的课程中,输入主要都是使用scanf这个函数.而在这节课上,冯老师讲解了字符串获取函数gets.在不需要控制符的情况 ...

  2. 2016福州大学软件工程Beta阶段团队作业成绩汇总

    1.评分规则 本次Beta阶段团队作业评分方法如下: 团队得分=[[7次scrum过程评分+(小组互评得分+教师评分)/2]/2],其中过程.小组.教师各30分 说明:由于没有规定提交团队贡献比,因此 ...

  3. 耿丹CS16-2班课堂测试作业汇总

    Deadline: 2016-11-01 11:59 作业内容 课堂测试作业总结 00.题目得5分,多半扣在格式上,有些同学代码写得很过分,已经很仁慈对待,同学们珍惜之: 01.界面设计得分不好,换行 ...

  4. SQL SERVER 中如何用脚本管理作业

    在SQL SERVER中用脚本管理作业,在绝大部分场景下,脚本都比UI界面管理作业要高效.简洁.打个简单的比方,如果你要查看作业的运行时长,如果用UI界面查看,100个作业,你就得在历史记录里面至少查 ...

  5. Spark&Hive:如何使用scala开发spark访问hive作业,如何使用yarn resourcemanager。

    背景: 接到任务,需要在一个一天数据量在460亿条记录的hive表中,筛选出某些host为特定的值时才解析该条记录的http_content中的经纬度: 解析规则譬如: 需要解析host: api.m ...

  6. 软件工程(QLGY2015)第三次作业点评(含成绩)

    相关博文目录: 第一次作业点评 第二次作业点评 第三次作业点评 团队信息 本页点评团队1-22,其他组见:http://www.cnblogs.com/xiaozhi_5638/p/4490764.h ...

  7. 作业成绩 final-review 20161201-1203 15:05

    final-review阶段,20161201-20161203 15:05 final 评论II截止 20161204 09:00 申诉截止时间 20161207 12:00,微信联系杨贵福. 凡描 ...

  8. 作业成绩 final 20161124-1201 09:00

    final阶段,20161124-1201 09:00. 申诉截止时间 20161206 12:00,微信联系杨贵福. 凡描述需求或BUG时,应给出以下4项: 你期待看到的现象如何 你实际看到的现象 ...

  9. Spark源码系列(三)作业运行过程

    作业执行 上一章讲了RDD的转换,但是没讲作业的运行,它和Driver Program的关系是啥,和RDD的关系是啥? 官方给的例子里面,一执行collect方法就能出结果,那我们就从collect开 ...

随机推荐

  1. tensorflow 待阅读的资料

    tensorflow性能调优实践 https://www.jianshu.com/p/937a0ce99f56 2018.04.01 Deep Learning 之 最优化方法 https://blo ...

  2. AI AND THE BOTTOM LINE: 15 EXAMPLES OF ARTIFICIAL INTELLIGENCE IN FINANCE

    https://builtin.com/artificial-intelligence/ai-finance-banking-applications-companies f there's one ...

  3. springboot配置spring security 静态资源不能访问

    在springboot整合spring security 过程中曾遇到下面问题:(spring boot 2.0以上版本   spring security 5.x    (spring  secur ...

  4. C++面向对象程序设计学习笔记(4)

    类与对象(2) string类 C++不仅向下兼容C的字符表示方法,也声明了一种更方便的字符串类型,即string类. 想要使用string类,必须包括头文件string,即要声明 #include& ...

  5. docker sentry 配置文件位置

    root@50f8462579a8:/etc/sentry# cd /etc/sentry/ root@50f8462579a8:/etc/sentry# ls config.yml sentry.c ...

  6. springboot对JPA的支持

    springboot之jpa支持 导入相关pom依赖 <dependency> <groupId>org.springframework.boot</groupId> ...

  7. wait函数和waitpid的使用和总结

    wait和waitpid出现的原因 SIGCHLD --当子进程退出的时候,内核会向父进程发送SIGCHLD信号,子进程的退出是个异步事件(子进程可以在父进程运行的任何时刻终止) --子进程退出时,内 ...

  8. [学习笔记] 网络最大流的HLPP算法

    #define \(u\)的伴点集合 与\(u\)相隔一条边的且\(u\)能达到的点的集合 \(0x00~ {}~Preface\) \(HLPP(Highest~Label~Preflow~Push ...

  9. [LeetCode] 885. Spiral Matrix III 螺旋矩阵之三

    On a 2 dimensional grid with R rows and C columns, we start at (r0, c0) facing east. Here, the north ...

  10. Python-lambda使用

    什么是lambda 匿名函数,不需要命名的函数: 语法 lambda 参数 : 返回值 g = lambda x: 2*x+1 g(2) >5