$emit失效的原因

954 阅读1分钟

前端小朋友遇到this.$emit无法发布事件,定位后发现部分小驼峰命名法(camelCase)的函数会失效。

解决方法:使用"-"命名法(camel-case)或者this.$parent.method解决。