五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(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)用的評論 (共 條)

分享到微博請遵守國家法律
云浮市| 科技| 大名县| 青龙| 巫山县| 明星| 惠州市| 娱乐| 昔阳县| 上饶市| 巴彦淖尔市| 武夷山市| 民县| 会东县| 铜川市| 阿拉尔市| 绩溪县| 广州市| 营山县| 习水县| 西畴县| 潞西市| 临沧市| 安宁市| 郁南县| 郸城县| 平度市| 西乡县| 红原县| 景洪市| 中山市| 临朐县| 铜川市| 宁强县| 长武县| 永清县| 高阳县| 眉山市| 南雄市| 偏关县| 旬邑县|