Skip to content
Advertisement

access method outside vue component

i am new in vuejs. i have created comment feature similar with here, but due to certain circumstances i have to improvise it. i use vue component but it couldn’t access method inside my vue. if user has already post comment, any user may be able to reply that particular comment. however, i received vue warn “Property or method ‘replyComment’ is not defined on the instance but referenced during render”. can anyone help me please?

JavaScript
JavaScript

Advertisement

Answer

replyComment is defined in the second Vue instance (#kalas), but referenced in the first instance’s template (#replykomen). Move/copy the method to the first Vue instance’s methods to resolve the error.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement