現在親コンポーネントから子コンポーネントにdata
を渡そうとしているのですが、うまくいきません。props
にv-bind
した変数を設定しているのですが、うまくいきません。
//親コンポーネント <template> <Test v-model="value"/> </template> <script> export default { components: { Test: () => import('@/components/main/test.vue'), }, data() { return { value: { id: "", width: 0, height: 0, }, } }, } </script>
//子コンポーネント <template> <p>{{ value }}</p> </template> <script> export default { props: ['value'], } </script>
#追記
下記方法でもpropsデータがundefindになってしまいました。
//親コンポーネント <template> <test :value="value"/> </template> <script> export default { components: { Test: () => import('@/components/main/test.vue'), }, data() { return { value: { id: "", width: 0, height: 0, }, } }, } </script>
//子コンポーネント <template> <p>{{ value }}</p> </template> <script> export default { props: ['value'], } </script>

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/01/10 07:22
2019/01/10 07:26
2019/01/10 07:33
2019/01/10 07:41
2019/01/10 07:43