vueのpropsを使用したコードを書いていますが、受け渡しがおかしいのかうまくいきません。
値を指定しているはずなのにnot defined が表示されてしまいます。
発生している問題・エラーメッセージ
app.js?id=63693c9879da2cb5ccb5:116707 [Vue warn]: Property or method "msg" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property.
該当のソースコード
App.vue
<template> <div class="source"> <EditFormview msg="文字を渡す" /> </div> </template> <script> import EditFormview from "./test.vue"; export default { components: { EditFormview }, data() { return { editVisible: false, } } </script>
test.vue
<template> <div>test : {{ msg }}</div> </template> <script> export default { props: ['msg'], data() { return { msg:'デフォルト文字', }; } } </script>
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。