第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定

為什么刪不了?????WTF

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<meta http-equiv="X-UA-Compatible" content="ie=edge">

<title>todoList</title>

<style>

*{

margin: 0;

padding: 0;

font-size: 20px;

text-align: center;

}

body{

background-color: #f56;

}

#box{

margin-top: 200px;

color: white;

font-weight: 700;

}

</style>

<script src="./vue.js"></script>

</head>

<body>

<div id="box">

<input type="text" v-model="txtValue">

<input type="button" @click='handleClick' value="提交">

<ul>

<todo-item

v-for="(item,index) of list"

:key="index"

:content="item"

:index="index"

@delete="handleDelete"

></todo-item>

</ul>

</div>

<script>

//創(chuàng)建一個全局組件

Vue.component('todo-item',{

props:['content','index'],

template:'<li @click="handleClick">{{content}}</li>',

methods:{

handleClick:function(){

this.$emit('delete',this.index)

}

}

})



new Vue({

el:"#box",

data:{

txtValue:'',

list:[]

},

methods:{

handleClick:function(){

this.list.push(this.txtValue),

this.txtValue=''

},

handleDelete:function(index){

this.list.splice=(index,1)

}

}

})

</script>

</body>

</html>


正在回答

3 回答

this.list.splice=(index,1)? ? ? ? ?=>? ? ? ? ? ?this.list.splice(index,1)?

1 回復(fù) 有任何疑惑可以回復(fù)我~
#1

毛Bing 提問者

有區(qū)別嗎?
2018-08-19 回復(fù) 有任何疑惑可以回復(fù)我~
#2

哈利法塔上的石頭 回復(fù) 毛Bing 提問者

splice是一個數(shù)組方法,方法調(diào)用是fn()。你給他賦值 fn =(index, 1)是想干什么。。。
2018-08-21 回復(fù) 有任何疑惑可以回復(fù)我~

方法不是變量,不能加等號

0 回復(fù) 有任何疑惑可以回復(fù)我~

splice是一個數(shù)組方法,方法調(diào)用是fn()。你給他賦值 fn =(index, 1)是想干什么。。。

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報

0/150
提交
取消

為什么刪不了?????WTF

我要回答 關(guān)注問題
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號