|
|
@@ -15,37 +15,39 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import {mapState,mapMutations} from 'vuex' |
|
|
|
|
|
|
|
export default { |
|
|
|
name: 'App', |
|
|
|
data() { |
|
|
|
return { |
|
|
|
footBarList: [ |
|
|
|
{ |
|
|
|
iconY: require('./assets/images/home-y.png'), |
|
|
|
iconN: require('./assets/images/home-n.png'), |
|
|
|
checked: true, |
|
|
|
title: '首页', |
|
|
|
path: 'home', |
|
|
|
}, |
|
|
|
/* { |
|
|
|
iconY: require('./assets/images/bill1.png'), |
|
|
|
iconN: require('./assets/images/bill.png'), |
|
|
|
checked: false, |
|
|
|
title: '账单', |
|
|
|
path: 'vueView', |
|
|
|
}, */ |
|
|
|
{ |
|
|
|
iconY: require('./assets/images/user-y.png'), |
|
|
|
iconN: require('./assets/images/user-n.png'), |
|
|
|
checked: false, |
|
|
|
title: '我的', |
|
|
|
path: 'person', |
|
|
|
}, |
|
|
|
] |
|
|
|
// footBarList: [ |
|
|
|
// { |
|
|
|
// iconY: require('./assets/images/home-y.png'), |
|
|
|
// iconN: require('./assets/images/home-n.png'), |
|
|
|
// checked: true, |
|
|
|
// title: '首页', |
|
|
|
// path: 'home', |
|
|
|
// }, |
|
|
|
// /* { |
|
|
|
// iconY: require('./assets/images/bill1.png'), |
|
|
|
// iconN: require('./assets/images/bill.png'), |
|
|
|
// checked: false, |
|
|
|
// title: '账单', |
|
|
|
// path: 'vueView', |
|
|
|
// }, */ |
|
|
|
// { |
|
|
|
// iconY: require('./assets/images/user-y.png'), |
|
|
|
// iconN: require('./assets/images/user-n.png'), |
|
|
|
// checked: false, |
|
|
|
// title: '我的', |
|
|
|
// path: 'person', |
|
|
|
// }, |
|
|
|
// ] |
|
|
|
}; |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
...mapState(['footBarList']), |
|
|
|
// 动态设置过渡样式 |
|
|
|
direction: function() { |
|
|
|
const currentPath = this.$route.path; |
|
|
@@ -72,17 +74,19 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
created() { |
|
|
|
let index = sessionStorage.getItem('navIndex') != 'undefined' ? sessionStorage.getItem('navIndex') : 0 |
|
|
|
this.selRouter(index) |
|
|
|
// let index = sessionStorage.getItem('navIndex') != 'undefined' ? sessionStorage.getItem('navIndex') : 0 |
|
|
|
this.selRouter(0) |
|
|
|
console.log(this.selRouter,this.footBarList,"??|"); |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
selRouter(index) { |
|
|
|
sessionStorage.setItem('navIndex',index) |
|
|
|
this.footBarList.map(item => { |
|
|
|
item.checked = false; |
|
|
|
}) |
|
|
|
this.footBarList[index].checked = true; |
|
|
|
}, |
|
|
|
...mapMutations(['selRouter']), |
|
|
|
// selRouter(index) { |
|
|
|
// sessionStorage.setItem('navIndex',index) |
|
|
|
// this.footBarList.map(item => { |
|
|
|
// item.checked = false; |
|
|
|
// }) |
|
|
|
// this.footBarList[index].checked = true; |
|
|
|
// }, |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|