abuvulkanik
abuvulkanik

Reputation: 89

vuejs-framework7 toolbar route

I am working on a app made with Framework7 and vuejs.

I have bottom toolbar but i have routing problem here.

here's my code

route.js

{
path: '/about/',
component: require('./assets/vue/pages/about.vue')}

main.vue

<div class="toolbar tabbar tabbar-labels">
  <div class="toolbar-inner">
    <a class="item-link tab-link" href="/about/">
      <i class="fa fa-home"></i>
      <span class="tabbar-label">Home</span>
    </a>
  </div>
</div>

when i clicked the toolbar i get the error Cannot GET /about/.

but when i clicked same link from outside the toolbar, it works...

Someone have any idea or have a better solution?

Upvotes: 8

Views: 434

Answers (1)

tianzhipeng
tianzhipeng

Reputation: 2209

SPA project means all the pages are base on a same uri, distinguished by following '#', for example:

So all the pages are on uri '/', '/about' != '/#/about'

You should use <router-link to="/about">Go to About</router-link> or use js code router.push({ path: 'about' }).

See vue-router

Upvotes: 0

Related Questions