What's the correct way to pass props as initial data in Vue.js 2?

后端 未结 3 1758
無奈伤痛
無奈伤痛 2020-12-12 11:00

So I want to pass props to an Vue component, but I expect these props to change in future from inside that component e.g. when I update that Vue component from inside using

3条回答
  •  独厮守ぢ
    2020-12-12 11:32

    I believe you are doing it right because it is what's stated in the docs.

    Define a local data property that uses the prop’s initial value as its initial value

    https://vuejs.org/guide/components.html#One-Way-Data-Flow

提交回复
热议问题