1 Star 0 Fork 0

wojiaosunjinxin/day03

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
01index-ToDolist.html 3.15 KB
一键复制 编辑 原始数据 按行查看 历史
wojiaosunjinxin 提交于 2022-10-12 21:41 . tijiao
<!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>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wojiaosunjinxin/day03.git
[email protected]:wojiaosunjinxin/day03.git
wojiaosunjinxin
day03
day03
master

搜索帮助