T
T
triplepointer2021-03-31 13:02:06
Vue.js
triplepointer, 2021-03-31 13:02:06

How to correctly connect VueRouter via cdn?

I connected scripts in the head tag as follows:



In main.js, when I write mode: 'history', nothing is displayed:

const routes = [
  {path: '/', name: 'blank', component: BlankPage},
  {path: '/directory1', name: 'directory1', component: Directory1},
  {path: '/directory2', name: 'directory2', component: Directory2},
  {path: '/directory3', name: 'directory3', component: Directory3},
]

const router = new VueRouter({
  routes,
  mode: 'history'
})

const app = new Vue({
  router,
}).$mount('#app')


If I remove mode:'history' it is displayed. How to fix the situation?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question