1 Star 0 Fork 0

jinlllll/day03

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
TodoList.html 3.10 KB
一键复制 编辑 原始数据 按行查看 历史
jinlllll 提交于 2022-10-12 22:51 . 作业
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
*{
margin: 0;padding: 0;
}
#app{
width: 96%;
margin: auto;
}
.input{
margin-top: 10px;
display: flex;
justify-content: space-between;
}
.input input{
height: 40px;
width: 80%;
border: none;
outline: none;
padding-left: 20px;
background-color: #f5f5f5;
}
.input span{
line-height: 40px;
margin: 0 10px;
}
.suammry {
margin: 10px 0;
height: 34px;
line-height: 25px;
}
.suammry span{
height: 26px;
margin-right: 14px;
padding: 2px 13px;
display: inline-block;
border-radius: 5px;
background-color: lightseagreen;
color: white;
font-size: 14px;
}
.box .list .li{
color: white;
display: flex;
align-items: center;
justify-content: space-between;
text-align: left;
padding-left: 10px;
margin: 10px 0;
background-color: lightseagreen;
line-height: 40px;
}
.box .list .li span{
width: 25%;
display: inline-block;
margin-right: 10px;
}
.box .list .li span:nth-child(2){
width: 5%;
}
.box .list .li span:nth-child(4){
text-align: right;
}
.empty{
text-align: center;
padding: 50px 0;
}
#app .box .unfinished{
background-color: red;
}
</style>
</head>
<body>
<div id="app">
<div class="input">
<input type="text" placeholder="输入任务名称" v-model="text">
<span @click="add">增加</span>
</div>
<div class="suammry">
<span>全部任务( {{list.length}} )</span>
<span>已完成( {{list.length-unFinishCount}} )</span>
<span>未完成( {{unFinishCount}} )</span>
</div>
<h3>任务列表</h3>
<div class="box">
<div class="list" v-for="(item,index) in list" >
<div class="li" :class="{ unfinished: item.status==false }" :key="index">
<input type="checkbox" :checked="item.status" @click="changeStatus(item)">
<span>{{item.id}}</span>
<span>{{item.name}}</span>
<span @click="del(item,index)">删除</span>
</div>
</div>
<div v-show="list.length==0" class="empty">
任务列表为空,请添加一个任务!
</div>
</div>
</div>
</body>
</html>
<script src="./vue-2.5.21.js"></script>
<script src="./TodoList.js"></script>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/jinlllll/day03.git
[email protected]:jinlllll/day03.git
jinlllll
day03
day03
master

搜索帮助