45
33

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

エラーについて [Vue warn]:Property or method "name" is not defined on the instance but referenced during render.

Posted at
[Vue warn]: 
Property or method "name" 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. 
See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.
  • 意味

    • 該当のプロパティまたはメソッドはインスタンスで定義されていないが、レンダリング中に参照されている
    • プロパティを初期化することにより、データオプションで、またはクラスベースのコンポーネントで、このプロパティがリアクティブであることを確認してください。
  • 原因

    • datanameの初期値が定義されていないことが原因
  • 修正

<script>
export default {
  // 省略
  data() {
    return {
      name: "",
      // 省略
  },
  // 省略
}
45
33
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
45
33

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?