vuejs / Discussion

Vue.js discussion
167 stars 17 forks source link

the syntax for keypath #385

Closed lilchow closed 9 years ago

lilchow commented 9 years ago

what would be the keypath syntax for vm.$set(keypath,value) if I want to set the value of the levelB property of the data object? Is it "levelA.levelB" or some other thing?

data={ levelA: {levelB : "ab" } };

azamat-sharapov commented 9 years ago

vm.$set('levelA.levelB',value) or vm.levelA.$set('levelB',value)