改為msg.js后還是無法觸發點擊菜單改變kk的值
網頁可以顯示,但是compile結束后console里報錯:
[Vue warn]: Error in mounted hook: "TypeError: _msg_js__WEBPACK_IMPORTED_MODULE_0___default.a.$on is not a function"
found in
---> <Right> at src/components/Right.vue
? ? ? ?<First> at src/views/First.vue
? ? ? ? ?<App> at src/App.vue
? ? ? ? ? ?<Root>
TypeError: _msg_js__WEBPACK_IMPORTED_MODULE_0___default.a.$on is not a function
? ? at VueComponent.mounted (Right.vue?df38:17)
? ? at invokeWithErrorHandling (vue.runtime.esm.js?2b0e:1854)
? ? at callHook (vue.runtime.esm.js?2b0e:4213)
? ? at Object.insert (vue.runtime.esm.js?2b0e:3139)
? ? at invokeInsertHook (vue.runtime.esm.js?2b0e:6340)
? ? at Vue.patch [as __patch__] (vue.runtime.esm.js?2b0e:6559)
? ? at Vue._update (vue.runtime.esm.js?2b0e:3939)
? ? at Vue.updateComponent (vue.runtime.esm.js?2b0e:4060)
? ? at Watcher.get (vue.runtime.esm.js?2b0e:4473)
? ? at new Watcher (vue.runtime.esm.js?2b0e:4462)
點擊菜單后報錯
[Vue warn]: Error in v-on handler: "TypeError: _msg_js__WEBPACK_IMPORTED_MODULE_0___default.a.$emit is not a function"
found in
---> <Left> at src/components/Left.vue
? ? ? ?<First> at src/views/First.vue
? ? ? ? ?<App> at src/App.vue
? ? ? ? ? ?<Root>
TypeError: _msg_js__WEBPACK_IMPORTED_MODULE_0___default.a.$emit is not a function
? ? at VueComponent.menu1 (Left.vue?162a:25)
? ? at invokeWithErrorHandling (vue.runtime.esm.js?2b0e:1854)
? ? at HTMLLIElement.invoker (vue.runtime.esm.js?2b0e:2179)
? ? at HTMLLIElement.original._wrapper (vue.runtime.esm.js?2b0e:6911)
Right.vue里kk的值也沒有發生變化。求解
2019-11-30
你這里怕是中文符號吧
2019-11-18
應該是沒反應過來,我的也是,半個多小時都不行,然后我尋思我代碼是正確的,是不是點擊事件出了問題,我就把@刪了重新寫了,就能改變了,然后我撤銷回原來的,也可以觸發
2019-11-02
我是來拿經驗的