Background: the following problems occur when the project switches the interface through the menu bar. Although it does not affect the switching of the interface and the use of the system, it will affect the robustness of the system
Reason: the problem shown in the screenshot above is the problem when the system switches routes, mainly due to the version of Vue router. The callback form of Vue router above 3.0 is in the form of promise API, and a promise is returned. If no error is caught, the console will always show the warning above.
Solutions:
1. Install a lower version of Vue router or catch throw in errors
2. Delete node_ Modules folder, and then use “cnpm install” to re install the dependency
3. If the Vue router installed is still the wrong version when downloading the dependency package again, how to solve it?The solution is also very simple. Run NPMI Vue in the project directory- [email protected] -S is enough
4. If you don’t want to change the version of Vue router or it’s still useless, add the following lines in main.js or router.js in SRC folder of project directory:
import Router from 'vue-router'
const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
}
If you have any questions or suggestions, you are welcome to leave a message in the comment area ([
Read More:
- Error 1: Vue quickly clicks the route to jump. Error: uncaught (in promise) error: request aborted
- Error in created hook: “referenceerror:” promise “undefined” Vue cli project Google is right, ie reported an error, “promise” undefined“
- Easywasmlayer reports an error uncaught (in promise) domexception when playing a video
- ./src/router/index.js Module not found: Error: Can‘t resolve ‘@/views/tet_demo‘ in ‘D:\admin\src\rou
- After NPM run dev is running, the browser does not respond and reports an error in. / ~ / Babel loader / lib! / ~ / Vue loader / lib/ selector.js?type=script&in
- The echots in Vue reports an error. After obtaining the DOM element, the chart can be displayed. The console still reports an error
- How to distinguish the source channel of router.push jump fast application
- Path cannot be used with params in this. $router. Push() method, otherwise params will be invalid
- Use less.js to verify and report an error in the Vue file of vscode
- Vue introduces ecarts, init initializes and reports an error
- Vue install reports an error operation not allowed
- Vue introduction path is correct, but it always reports an error: already included file name‘ ××ב differs from file name ‘ ××ב only in casing.
- Idea installation vue.js After plug-in, new has no Vue component
- Vue3. X reports an error using vantui. Failed to resolve component: Van-**-**
- [_ Note] Vue.js reported an error: Cannot read property’validate’ of undefined”
- Vue init webpack command error Vue cli / node_ modules/_ [email protected]@rimraf/rimraf.js :313
- Vue reports an error sasserror: expected newline
- Ie11 reports an error unhandled promise rejection typeerror: the object does not support
- Vue project error: uncaught typeerror: vuex__ WEBPACK_ IMPORTED_ MODULE_ 1__ . default.store is not a constructor
- Two methods of fixing WPF menu bar after scrolling to the top