store.js 中的访问路由(Vuex/Nuxt)

Jor*_*dan 5 nuxt.js

如何访问 store.js 文件中的路由?

我想要访问store.jspathfullPath在其中。

Har*_*hah 2

您应该能够访问fullPathNuxt.js 中的内部商店,如下所示

完整路径:this.$router.currentRoute.fullPath

询问:this.$router.currentRoute.query

希望对你有帮助!

  • `this` 在商店内未定义,这如何是正确的答案? (7认同)