鍍金池/ 問答/HTML/ vue組件的內(nèi)容不顯示

vue組件的內(nèi)容不顯示

我準(zhǔn)備寫個(gè)在移動(dòng)端調(diào)試的demo,分頭部,內(nèi)容和底部,底部有三個(gè)菜單,公共的頭部和底部放在components文件夾中,其他頁面組件放在pages文件夾中;現(xiàn)在問題是組件中的文字不顯示(只有首頁顯示):

clipboard.png
猜測(cè)是哪里的路徑寫錯(cuò)了,但是又找不到,求助;

clipboard.png

clipboard.png

我的router/index.js文件如下:

import Vue from 'vue'
import Router from 'vue-router'
import Indexs from '../pages/index'
import Content from '../pages/content'
import Mine from '../pages/mine'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'index',
      component: Indexs
    },
    {
      path: '../pages/content',
      name: 'content',
      component: Content
    },
    {
      path: '../pages/mine',
      name: 'mine',
      component: Mine
    }
  ]
})

components/footer.vue文件:

<template>
  <div class="footer">
    <a @click="changeTab(index)" :key="index" v-for="(tab, index) in tabs">{{ tab.title }}</a>
  </div>
</template>

<script>
export default {
  name: 'footers',
  data () {
    return {
      tabs: [
        {
          title: '首頁',   
          path: '/'      
        },
        {
          title: '內(nèi)容',
          path: '../pages/content'        
        },
        {
          title: '我的',
          path: '../pages/mine'          
        }
      ]
    }
  },
  methods: {
    changeTab (index) {
      this.$router.push({path:this.tabs[index].path});
    }
  }
}
</script>

<style scoped>
.footer{
  height: 50px;
  width: 100%;
  line-height: 50px;
  position: fixed;
  bottom: 0;
  background-color: #999;
  color: #fff;
  text-align: center;
}
.footer a {
  display: inline-block;
  width: 33%;
}
</style>
  
回答
編輯回答
陌如玉

router/index.js文件下的path路徑指的是路由路徑,你改為/pages/mine試試

2017年4月20日 21:07