<template>
<div id="app" class="g-container">
<div class="g-view-container">
<router-view></router-view>
</div>
<div class="g-footer-container">
<c-tabbar></c-tabbar>
</div>
</div>
</template>
<script>
import CTabbar from '@/components/tabbar';
export default {
name: 'App',
components: {
CTabbar
}
};
</script>
上面的是App.vue
2019-02-20 15:30:16
这个是Tabbar/index.vue
<template>
<div class="g-tabbar">
<router-link class="g-tabbar-item" to="{name:'home'}">
<i class="iconfont icon-home"></i>
<span>首页</span>
</router-link>
<router-link class="g-tabbar-item" to="{name:'category'}">
<i class="iconfont icon-category"></i>
<span>分类</span>
</router-link>
<router-link class="g-tabbar-item" to="{name:'cart'}">
<i class="iconfont icon-cart"></i>
<span>购物车</span>
</router-link>
<router-link class="g-tabbar-item" to="{name:'personal'}">
<i class="iconfont icon-personal"></i>
<span>个人中心</span>
</router-link>
</div>
</template>
<script>
export default {
name: 'CTabbar'
};
</script>
<style lang="scss" scoped>
@import '~@/assets/scss/mixins';
.router-link-active{
color:$link-active-color;
}
</style>
2019-02-20 15:31:24
import Vue from 'vue';
import App from './App';
import router from './router';
import '@/assets/scss/index.scss';
// import fastclick from 'fastclick';
import '@/config/rem.js'; // 移动端的适配
Vue.config.productionTip = false;
// fastclick.attach(document.body);
/* eslint-disable no-new */
new Vue({
el: '#app',
router,
render: h => h(App)
});
这是man.js中的代码,要不引入index.scss文件就可以点击,引入的话就不能点击
2019-02-20 15:42:01
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星