vue 第一天
-
@click
-
:name
-
this.id=this.name=’’
-
@click.prevent=“del(item.id)” //阻止默认行为 如
-
-
arry.some((item,i)=>{ if(item.id==id){ return true}})
-
arry.some((item,i)=>{ if(item.id==id){ this.list.splice(i,1) return true //终止循环 } })
-
this.list.findIndex(item=>{ if(item.id==id) return true //终止循环 返回 index //索引 })
-
this.list.splice(index,1)
-
<tr v-for="item in search(keywords)"></tr> methods{ search(keywords){ this.list.forEarch(item=>{ if(item.name.indexof(keywords)!=-1){ newlist.push(item) } }) return newlist } }
-
var newList=this.list.filter(item=>{ if(item.name.includes(keywords)){ return item } })
-
forEach some filter findIndex includes contains(jquery)
-