组件化带删除按钮的TodoList
<todo-item v-for="(item,index) in list" :key="index" v-bind:food="item" v-bind:index="index" v-bind:action="delClick"></todo-item>
props:["food","index","action"],
template:'<li>{{food}} <button @click="action(index)">del</button></li>'
<todo-item v-for="(item,index) in list" :key="index" v-bind:food="item" v-bind:index="index" v-bind:action="delClick"></todo-item>
props:["food","index","action"],
template:'<li>{{food}} <button @click="action(index)">del</button></li>'
2018-05-18
带有删除按钮的TodoList
<li v-for="(item,index) in list" :key="index">{{item}} <button @click="delClick(index)">del</button> </li>
delClick:function(index){
this.list.pop(index)
}
<li v-for="(item,index) in list" :key="index">{{item}} <button @click="delClick(index)">del</button> </li>
delClick:function(index){
this.list.pop(index)
}
2018-05-18
关于webStrom中vue指令报错的解决方法:
Setting-> Editor -> Inspections
找到XML,把 Unbound XML namespace prefix的勾去掉
Setting-> Editor -> Inspections
找到XML,把 Unbound XML namespace prefix的勾去掉
2018-05-17
<div v-on:click="handleClick">{{content}}</div>
中间content的是html代码的话,也不会被解析吗比如content:"<h1>hello</h1>"
显示的也是<h1>hello</h1>
中间content的是html代码的话,也不会被解析吗比如content:"<h1>hello</h1>"
显示的也是<h1>hello</h1>
2018-05-17