代码拉取完成,页面将自动刷新
<!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;
}
html,
body {
height: 100%;
width: 100%;
}
.header {
display: flex;
justify-content:
space-between;
align-items: center;
margin-bottom: 20px;
}
.header input {
width: 90%;
color: white;
height: 40px;
border-radius: 20px;
border: none;
outline: none;
text-align: center;
background-color: rgba(0, 0, 0, 0.3);
}
.header span {
color: #20B2AA;
font-weight: bolder;
}
.sub {
display: flex;
justify-content: space-around;
}
.sub span {
width: 30%;
background: #20B2AA;
text-align: center;
height: 40px;
color: white;
border-radius: 10px;
margin-bottom: 20px;
line-height: 40px;
}
.sub span:nth-child(3) {
background-color: red;
}
.liston {
margin-top: 20px;
display: flex;
justify-content: space-around;
height: 40px;
align-items: center;
background: #20B2AA;
}
.liston input {
width: 10%;
text-align: center;
}
.liston span {
flex: 1;
text-align: center;
}
.active {
background-color: red;
}
.tishi {
font-size: 23px;
margin: 30px 50px;
}
</style>
</head>
<body>
<div id="app">
<div class="header">
<input v-model="search" type="text" placeholder="输入任务名称">
<span @click="addlistArr">新增</span>
</div>
<div class="sub">
<span>全部任务({{listArr.length}})</span>
<span>已完成({{listArr.length-unfinish}})</span>
<span>未完成({{unfinish}})</span>
</div>
<div class="buttom">
<div class="title">
<h2>任务列表</h2>
</div>
<div class="list">
<div class="liston" v-for="(item,index) in listArr" :class="{active:item.status==false}">
<input @click="finish(item)" type="checkbox" :checked="item.status">
<span>{{item.id}}{{item.content}}</span>
<div class="listright">
<span @click="deletelist(index,item)">删除</span>
</div>
</div>
</div>
</div>
<div v-show="listArr.length == 0" class="tishi">任务列表为空,请添加一个任务!</div>
</div>
<script src="./vue-2.5.21.js"></script>
<script src="./01index-ToDolist.js"></script>
</body>
</html>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。