javascript - Vue.js - How to render data changes in child component? -


so have parent component store has child component called order. data parent passed via props child, so:

parent

<order :order="order" /> 

child

props: ['order'] 

i need use new data variable in child component called orderids, declare that:

child

props: ['order'], data: () {   return {     orderids: object.keys(this.order)   } } 

then, render orderids in view:

{{orderids}} 

now, whenever order data changes in parent, updates prop order in child, not propagated through orderids.

how update orderids when changes in order?

instead of data use computed property.

computed: {     orderids: function () {       return object.keys(this.order);     }   } 

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -