ljc 5 years ago
parent
commit
200bef74c4
3 changed files with 36 additions and 17 deletions
  1. +24
    -7
      src/components/sidebar.vue
  2. +6
    -5
      src/views/Home.vue
  3. +6
    -5
      src/views/List.vue

+ 24
- 7
src/components/sidebar.vue View File

}] }]
} }
}, },
created() {
// var path=this.$route.path;
// var i,j,k;
// for(i=0;i<this.list.length;i++){
// for(j=0;j<this.list[i].children.length;j++){
// for(k=0;k<this.list[i].children[j].children.length;k++){
// if(path==this.pagePath[i][j][this.list[i].children[j].children[k]]){
// this.list[i].children[j].show=true;
// break
// }
// }
// }
// }
},
methods: { methods: {
getImg(img) { getImg(img) {
if (this.imgBaseUrl) {
return this.imgBaseUrl + 'sidebar/' + img;
} else {
return require('../assets/' + 'sidebar/' + img);
}
return require('../assets/' + 'sidebar/' + img);
// if (this.imgBaseUrl) {
// return this.imgBaseUrl + 'sidebar/' + img;
// } else {
// return require('../assets/' + 'sidebar/' + img);
// }
}, },
open() { open() {
this.$refs.sidebar.style.left = '0%'; this.$refs.sidebar.style.left = '0%';
}, },
show3(index1, index2, title) { show3(index1, index2, title) {
this.close() this.close()
console.log(this.pagePath[index1][index2][title])
this.$router.replace(this.pagePath[index1][index2][title])
var path=this.pagePath[index1][index2][title];
if(path!=this.$route.path){
this.$router.replace(this.pagePath[index1][index2][title])
}
} }
} }
} }

+ 6
- 5
src/views/Home.vue View File

computed: mapState(['imgBaseUrl']), computed: mapState(['imgBaseUrl']),
methods: { methods: {
getImg(img) { getImg(img) {
if (this.imgBaseUrl) {
return this.imgBaseUrl+'home/' + img;
} else {
return require('../assets/'+'home/' + img);
}
return require('../assets/'+'home/' + img);
// if (this.imgBaseUrl) {
// return this.imgBaseUrl+'home/' + img;
// } else {
// return require('../assets/'+'home/' + img);
// }
}, },
toList(){ toList(){
this.$router.replace('/list') this.$router.replace('/list')

+ 6
- 5
src/views/List.vue View File

}, },
methods: { methods: {
getImg(img) { getImg(img) {
if (this.imgBaseUrl) {
return this.imgBaseUrl + 'list/' + img;
} else {
return require('../assets/' + 'list/' + img);
}
return require('../assets/' + 'list/' + img);
// if (this.imgBaseUrl) {
// return this.imgBaseUrl + 'list/' + img;
// } else {
// return require('../assets/' + 'list/' + img);
// }
}, },
toBackHome() { toBackHome() {
if (this.step == 1) { if (this.step == 1) {

Loading…
Cancel
Save