New World

[Vue.js] Property or method "updateName" is not defined on the instance but referenced during render. // Invalid handler for event "click": got undefined 에러 본문

Programming/Bug Zero

[Vue.js] Property or method "updateName" is not defined on the instance but referenced during render. // Invalid handler for event "click": got undefined 에러

hyeovi 2024. 1. 8. 21:21
728x90
반응형

 

콘솔 에러

main.js:12 [Vue warn]: Property or method "updateName" 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://v2.vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.

 

main.js:12 [Vue warn]: Invalid handler for event "click": got undefined found in

 

위 에러는 script 안에 메소드를 만들때 아래와 같이 만들어서 에러가 표출된 것으로 확인된다.

 

메소드를 하나만 썼다고 해서 method가 되는 것은 아니니 주의하자.. (바보같은 주인장)

 

methods로 바꾸면 정상적으로 동작한다.

반응형
Comments