LoginSignup
0
0

More than 1 year has passed since last update.

[備忘録]いつも通り書いていたのに発生したVue.jsのエラー

Last updated at Posted at 2022-03-30

新しいコンポーネント作成時に発生しました。

エラー内容
vue.esm.js?efeb:628 [Vue warn]: 
Property or method "message" 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.

found in

---> <ManyInput> at src/components/ManyInput.vue
       <App> at src/App.vue
         <Root>

エディターにエラーが発生したわけではなく、ブラウザに表示時にコンソールにてエラー表示。
下記がコンポーネントでの記述内容。

ManyInput.Vue
<template>
    <div id="ManyInput">
        {{message}}
    </div>
</template>

<script>
export default {
    name:"ManyInput",
    deta(){
        return {
            message:"複数同時入力のテストです。"
        }
    },
    mounted(){
        console.log("manyInput")
    },
}
</script>

問題はタイポ

data()をdeta()にしていたのが原因。
エラーの内容は、dataで定義していないものが、templateで利用されているというよう。

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