Category : vue-router

I have a side bar containing multiple sidebar items like this <side-bar> <template slot="links"> <sidebar-item :link="{name: ‘Home’, icon: ‘ni ni-shop text-primary’, path: ‘/dashboard’}" /> <sidebar-item :link="{name: ‘Videos’, icon: ‘ni ni-tv-2 text-primary’, path: ‘/videos’}"/> <sidebar-item :link="{name: ‘Category’, icon: ‘ni ni-single-copy-04 text-primary’, path: ‘/category’}"/> <sidebar-item :link="{name: ‘Comments’, icon: ‘ni ni-ambulance text-primary’, path: ‘/comments’}"/> <sidebar-item :link="{name: ‘Artist’, icon: ..

Read more

I have implemented a catch all route as is suggested here https://medium.com/@ishoshot/page-not-found-on-reload-vuejs-netlify-c71716e97e6 however it does not catch urls which partially match a defined route. For example routes: [ { path: "/album/:album", name: "album", component: Album, }, { path: "/", name: "home", component: Home, }, { path: "/*", component: NotFound, }, ], mysite.com/foo will direct to ..

Read more

I need to ask user if submit form or not in react project like in vue-router beforeRouteLeave guard: <script> export default { name: ‘RolePage’, methods: { http() { return new Promise(resolve => { setTimeout(() => { resolve({ ok: true }) }, 200) }) }, }, async beforeRouteLeave(to, from, next) { const answer = window.confirm(‘Do you ..

Read more

Suppose I created an route as: router.js: import Vue from "vue"; import Router from " vue-router"; import BookRoutes from "./routes/book"; Vue.use(Router) const router = new Router({ routes:[ { path: "/book", name: "book", component:{ render(c) { return c("router-view") } }, childern: BookRoutes } ] }) Routes-> book -> index.js const BookProfile = () => import (/* ..

Read more