【发布时间】:2019-08-18 00:35:15
【问题描述】:
我无法让 vue-logger 在我的 Vuex 存储文件中工作
我想在我的 Vuex 存储文件(和模块)中使用 vue-logger。但是,当我执行"Vue.log.info(....)" 之类的语句时,我不断收到错误消息:"TypeError: Cannot read property 'info' of undefined"。
我在商店文件中使用“this.$http.get”时遇到了类似的问题,但现在可以使用“Vue.http.get”(如StackOverflow Answer 中所述)。
但是,“this.$log.info”不起作用(原因现在对我来说很明显,因为在商店中我不在 vue 实例之外),但 "Vue.log.info" 也不起作用。
如何在 store 中使用 vue-logger?
【问题讨论】:
-
试试this
标签: javascript vue.js vuex