1
0

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 1 year has passed since last update.

【Vue warn】: Property or method "name" is not defined on the instance but referenced during render の解決方法

Posted at

はじめに

Vue.jsで開発しているときにエラーに出くわしたので備忘録としてここに残しておきます。
ちなみにめちゃくちゃ初歩的なエラーでした。。笑

エラー

erroe
【Vue warn】: 
Property or method "name" is not defined on the instance but referenced during render 
  • 意味

    • プロパティまたはメソッドのnameがインスタンスで定義されていないのに、レンダリング中に参照されてるよ
  • 原因

    • dataプロパティでnameのデフォルトの値が設定されていなかった

対処法

dataプロパティでnameのデフォルトの値を定義してあげることで解決できました。

app.vue
<script>
export default {
  // ...code
  data() {
    return {
      name: "",
      // ...code
  },
  // ...code
}
1
0
0

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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?