最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

vue 設(shè)計一個簡單待辦任務(wù)的應(yīng)用

2023-04-21 04:09 作者:蕪湖小量化  | 我要投稿

vue 部分

<template id="app">
?<div class="main-content">
? ?<span>任務(wù)事項</span>
? ?<form @submit.prevent="add_task">
? ? ?<input class="input-text" v-model="task_text" placeholder="添加待辦事項" />
? ? ?<button class="add_btn">添加</button>
? ?</form>
? ?<ol>
<!-- ? ? ?通過v-for實現(xiàn)循環(huán)渲染-->
? ? ?<li v-for="(item, index) in todos">
? ? ? ?{{item}}
? ? ? ?<button class="del-btn" @click="remove(index)">刪除</button>
? ? ? ?<hr/>
? ? ?</li>
? ?</ol>
?</div>
</template>

<script>
export default {
?name: "Todo",
?data(){
? ?return{
? ? ?// 待辦任務(wù)
? ? ?todos: [],
? ? ?task_text: '',
? ?}
?},
?methods:{
? ?// 添加一個任務(wù)
? ?add_task(){
? ? ?if (this.task_text.length === 0){
? ? ? ?alert('請輸入待辦事項')
? ? ? ?return
? ? ?}
? ? ?this.todos.push(this.task_text)
? ? ?this.task_text = ""

? ?},
? ?// 刪除長度為1的index
? ?remove(index){
? ? ?this.todos.splice(index, 1)
? ?}
?}
}
</script>

<style scoped>
?@import "@/assets/todo.css";
</style>

css 部分

.main-content{
? ?height: 350px;
? ?width: 500px;
? ?background-image:linear-gradient(0deg, #85c4e5 0%, #b0dcef 50%, #b0dcef 50%, #85c4e5 100%);

}
span{
? ?display: inline-flex;
? ?width: 500px;
? ?justify-content: center;
? ?margin-top: 20px;
? ?font-family: 楷體, sans-serif;
? ?color: #9031a1;
? ?letter-spacing: 5px;
}
form{
? ?margin-top: 10px;
? ?margin-left: 50px;
}
.input-text{
? ?width: 300px;
? ?height: 18px;
? ?font-size: 10px;
? ?font-family: 楷體,sans-serif;
? ?background-color: #e2d1f3;
? ?letter-spacing: 3px;
}
.add_btn{
? ?margin-left: 20px;
? ?background-color: #e2d1f3;
? ?letter-spacing: 3px;
? ?color: #186faf;

}
hr{
? ?margin-left: 0;
? ?width: 400px;
? ?border: 1px solid #ddb0ea;
}
li{
? ?margin-top: 15px;
? ?margin-left: 10px;
? ?font-family: 楷體, sans-serif;
? ?list-style: circle;
? ?color: #096b20;
? ?letter-spacing: 3px;
}
.del-btn{
? ?height: 20px;
? ?background-color: #e2d1f3;
? ?font-family: 楷體,sans-serif;
? ?border-color: #9fa4a6;
? ?color: #3e78c4;
? ?letter-spacing: 3px;
}

效果圖部分

應(yīng)用視圖


vue 設(shè)計一個簡單待辦任務(wù)的應(yīng)用的評論 (共 條)

分享到微博請遵守國家法律
沭阳县| 临泉县| 旺苍县| 石河子市| 东莞市| 南通市| 榆树市| 福泉市| 常德市| 鹿泉市| 金沙县| 章丘市| 喀什市| 阿拉善盟| 辉县市| 呼图壁县| 河间市| 新干县| 民乐县| 怀安县| 二连浩特市| 公主岭市| 铜梁县| 禄丰县| 三河市| 丰城市| 黄梅县| 错那县| 巴塘县| 上林县| 肇源县| 乌审旗| 泽州县| 报价| 桂林市| 磴口县| 曲麻莱县| 遂溪县| 阜阳市| 团风县| 牟定县|