A
A
Artem892018-06-17 12:57:32
Vue.js
Artem89, 2018-06-17 12:57:32

How to remove # from end of vue-router url?

I use vue-router to go inside the product, but the # sign is added to the end and when returning to the previous page with the back button, first the # is removed from the url, then it returns to the previous page, i.e. you need to click back twice. hashbang: false, mode: 'history' added, didn't help.
When you go to the product, you get a url like this: localhost:8080/shop/braids/32# Required
: localhost:8080/shop/braids/32
router

export default new Router({
  hashbang: false,
  mode: 'history',
  routes: [
    {
      path: '/shop/braids/:name',
      component: CanekalonsComponent
    },
  ]
})

transition along
methods: {
  viewCategory () {
    this.$router.push('/shop/braids/' + this.category.name)
  }
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2018-06-19
@atcrew

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

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question