vue 开发遇到的问题

总结在做对vue相关开发时遇到的一些问题,包括vue,vuex,vue router nuxt等。

vue

vuex

vue router

nuxt

同一个页面路由变化时没有触发asyncData

需要给page组件提供key和watchQuery属性,如

1
2
3
4
5
6
7
8
9
10
export default {
watchQuery: ['code'],
key: (to) => to.fullPath,
async asyncData ({query, store, error}) {
// do something when code is changed
return {
code: query.code
}
}
}

参考New asyncData is not applied when query is changed

other

node-sass 安装不上

需要安装windows-build-tools