Vue.js $set on array element does not trigger notification -
i have vue instance data contains array of objects. display data in table without issue.
upon clicking table rows, set "selected" property on corresponding data object using:
key.$set('testing', testing);
upon setting value, add custom css class the table row, without issue.
however, if simple output of entire array of objects @ bottom of page (such below), doesn't updated reflect new "testing" attribute have added.
{{ griddata | json }}
i able reproduce question using modified vue.js example code in jsfiddle:
https://jsfiddle.net/wdmatl/531axrtt/
notice when click on rows of data, either see "testing" or "not testing". new object data isn't reflected in json @ bottom of page. why not?
Comments
Post a Comment