Visual Studio Code breakpoint appearing in wrong place

To answer this for any particular case, one would need the launch.json configuration being used, and the source folder structure, at minimum. I have a true story from just last week to illustrate why: Background I recently inherited a relatively small Vue project, and immediately encountered the same problem. Breakpoints in VSCode were “jumpy” in … Read more

How to make dynamic routes on the vue router?

I suppose getDetailMenu is calling API method to get listMenu. You can create route dynamically using addRoutes method Pseudo code created() { this.getDetailMenu(this.$route.path) .then((listMenu) => { // you need to return listMenu from getDetailMenu listMenu.forEach((item, index) => createAndAppendRoute(item, index)) }) }, methods: { createAndAppendRoute: (item, index) => { console.log(item, index) // Base on your data, … Read more

Vuex Action vs Mutations

Question 1: Why did the Vuejs developers decide to do it this way? Answer: When your application becomes large, and when there are multiple developers working on this project, you will find that “state management” (especially the “global state”) becomes increasingly more complicated. The Vuex way (just like Redux in react.js) offers a new mechanism … Read more

Nuxt.js vuex store not persisted

Alright, so the behavior is totally logic. Vuex is not supposed to be persistent. For any persistence on the front-end, you need either: cookies localStorage pass it in the URL (query params) IndexedDB get the data back from making a call to a backend Some of the packages here may be useful: https://github.com/vuejs/awesome-vue#persistence If you … Read more