Straight to the point, no nonsense.
Using the Vue render list is very simple and convenient, but if you need to be in the rendering of the item to listen to the event can not be achieved, I have searched the Vue API did not find the appropriate way to solve, which also mentioned the use of Watch and vue.nextclick monitoring, but these can not be achieved, Distress Ah, but the wit I still think of the curve saved method, using the filter to implement, the code is as follows
<li v-for= "Item in List" > {item.content | setevent item.id, item.name}}</li>
new Vue ({
el: ",
data:{
list:[]
},
fliters:{
setevent:function (content, ID, name) {
//TODO handle your event .... return
content;
}
}
)
Filter functions always take the value of an expression as the first argument (item.content). Quoted parameters are treated as strings, and arguments without quotes are evaluated by expression. Here the expression item.id is passed to the filter as the second argument, and the value of the expression Item.name is computed as the third argument. Be sure to return the current Li need to display the content, otherwise li no data display, so that you can monitor the list item of the rendering event, powerful not. Ha ha.