Please enable JavaScript.
Coggle requires JavaScript to display documents.
07. ROUTING (NAVIGATION GUARDS (Globally (Global route navigation guards…
07. ROUTING
In vue-router, router-view is a component that renders a specified component based on the app’s location
Dynamic components constitute the ability to dynamically change (i.e. switch) between components based on a data attribute. This can be achieved by binding an is attribute to the reserved <component> element
-
vue-router’s default mode is hash. Hash mode URLs always contain a hash symbol (#) after the hostname. The hash mode basically means our application routes will be displayed like this - http://localhost:8080/#/dunkirk. The benefit to this often lies with allowing us to have multiple client side routes without having to provide the necessary server side fallbacks
In vue-cli Webpack projects, assets are usually handled in two ways
Keeping asset files in a static/ folder that is not processed by Webpack and must be referenced
using absolute paths
Keeping asset files in a static/ folder that is not processed by Webpack and must be referenced
using absolute paths
-
-
-
In addition to router.push(), we’re able to use router.go() to navigate forwards/backwards in the window history stack, or router.replace() to navigate without pushing an entry to the history stack
To navigate back once in the history stack, we’ll call router.go(-1) with -1 dictating going back by one record. click="$router.go(-1)"
-
Just like how store state should never be mutated directly, store state properties should never be
watched directly
NAVIGATION GUARDS
Globally
Global route navigation guards can be set up by specifying a beforeEach function on the entire router instance
-
-