Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.

Join them; it only takes a minute:

Sign up
Join the Stack Overflow community to:
  1. Ask programming questions
  2. Answer and help your peers
  3. Get recognized for your expertise

I have a Vue instance whose data contains an array of objects. I display this data in a table without issue.

Upon clicking the table rows, I set a "selected" property on the corresponding data object using:

key.$set('testing', testing);

Upon setting this value, I add a custom css class the the table row, without issue.

However, if I do a simple output of the entire array of objects at the bottom of the page (such as below), it doesn't get updated to reflect the new "testing" attribute I have added.

{{ gridData | json }}

I was able to reproduce my question using some modified vue.js example code in this JSFiddle:

https://jsfiddle.net/wdmatl/531axrtt/

Notice when you click on rows of data, you either see "testing" or "not testing". But this new object data isn't reflected in the json at the bottom of the page. Why not?

share|improve this question
    
FYI, this was a bug in Vue fixed in this commit: github.com/yyx990803/vue/commit/… – David K. Hess Jul 16 '15 at 16:00
    
Saw that, thanks! Haven't had a chance to confirm. – Dave Matl Jul 17 '15 at 16:35
    
If you are curious, here's where the discussion took place: github.com/vuejs/Discussion/issues/282 – David K. Hess Jul 17 '15 at 19:48

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.