Vue.js “Maximum call stack size exceeded” error. Passing data from parent to child failing

后端 未结 3 1677
轻奢々
轻奢々 2020-12-30 22:33

I cannot pass data from parent to child. I am using props, have tried returning data as well - no luck. I have a panel component (which is parent) with data and panelBody co

3条回答
  •  爱一瞬间的悲伤
    2020-12-30 23:20

    the sync has changed in vue2.

    https://vuejs.org/v2/guide/components.html#sync-Modifier

    you should use it this way

    
    

    and on child

    this.$emit('update:selected', shelf)
    

    OR you could do just this

    
    

    and on child

    this.$emit("select")
    

提交回复
热议问题