mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-10-02 02:06:38 +08:00
Breadcrumbs 0 version
This commit is contained in:
parent
43857121c4
commit
fcb6dc26bd
@ -1,12 +1,11 @@
|
||||
<template>
|
||||
<div class="crumbs" v-if="showTab">
|
||||
<el-breadcrumb separator-class="el-icon-arrow-right">
|
||||
<el-breadcrumb-item :to=item.path v-for="(item, index) in titleLists"
|
||||
:key="index">{{ item.meta.title }}</el-breadcrumb-item>
|
||||
<!-- <el-breadcrumb-item>商品管理</el-breadcrumb-item>
|
||||
<el-breadcrumb-item>商品分类</el-breadcrumb-item> -->
|
||||
</el-breadcrumb>
|
||||
|
||||
<el-breadcrumb separator-class="el-icon-arrow-right">
|
||||
<el-breadcrumb-item to="/" >{{ this.homepageName }}</el-breadcrumb-item>
|
||||
|
||||
<el-breadcrumb-item :to=item.path v-for="(item, index) in crumbs"
|
||||
:key="index">{{ item.title }}</el-breadcrumb-item>
|
||||
</el-breadcrumb>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -14,93 +13,25 @@
|
||||
import { mapState, mapMutations } from "vuex";
|
||||
|
||||
export default {
|
||||
props:["crumbs"],
|
||||
name:"crumbs",
|
||||
data() {
|
||||
return {
|
||||
title: "",
|
||||
path: "",
|
||||
titleLists: [
|
||||
{
|
||||
path: '/',
|
||||
name: 'index',
|
||||
meta:{
|
||||
title: '首页',
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
showTab: true,
|
||||
isShow: true,
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
watch: {
|
||||
$route() {
|
||||
this.setTitle();
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.setTitle();
|
||||
},
|
||||
|
||||
methods: {
|
||||
...mapMutations(["changemessage",'selectMenu']),
|
||||
setTitle() {
|
||||
console.log(this.$route.matched);
|
||||
console.log(this.titleLists);
|
||||
let userinfo=[]
|
||||
|
||||
|
||||
let saveUserInfo={
|
||||
path:'admin',
|
||||
name:'1',
|
||||
meta:'b341181c-aced-11e9-89bf-00163e0e8daf',
|
||||
|
||||
}
|
||||
userinfo.push(this.$route.matched);
|
||||
let list=[];
|
||||
console.log(userinfo);
|
||||
userinfo.map(item=>{
|
||||
console.log(item);
|
||||
list=item;
|
||||
})
|
||||
console.log(list);
|
||||
let anlist={
|
||||
path:'admin',
|
||||
name:'1',
|
||||
meta:'b341181c-aced-11e9-89bf-00163e0e8daf',
|
||||
}
|
||||
list.forEach(element=>{
|
||||
console.log(element);
|
||||
anlist=element
|
||||
})
|
||||
for(let i in list){
|
||||
saveUserInfo.path=list[i].path;
|
||||
saveUserInfo.name=list[i].name;
|
||||
saveUserInfo.meta=list[i].meta;
|
||||
}
|
||||
console.log(saveUserInfo);
|
||||
// store.commit('se', current.name);
|
||||
this.selectMenu({ data: saveUserInfo });
|
||||
console.log(this.$store.state.tabsList);
|
||||
this.titleLists=this.$store.state.tabsList;
|
||||
// console.log(userlisa);
|
||||
console.log(this.titleLists);
|
||||
},
|
||||
},
|
||||
// created(){
|
||||
// let user=this.$store.state.tabsList;
|
||||
// this.tags=user;
|
||||
// console.log(this.tags);
|
||||
// console.log(user);
|
||||
// console.log(this.$store.state.tabsList)
|
||||
// },
|
||||
|
||||
// mounted(){
|
||||
|
||||
// }
|
||||
return {
|
||||
homepageName:'首页'
|
||||
};
|
||||
},
|
||||
created(){
|
||||
if(this.showTab != false)
|
||||
this.showTab=true;
|
||||
},
|
||||
watch: {
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
|
||||
methods: {
|
||||
...mapMutations(["changemessage",'selectMenu'])
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
<div>
|
||||
<Myheader></Myheader>
|
||||
<div class="rc-top"></div>
|
||||
<tabs :crumbs="crumbs"></tabs>
|
||||
<div class="rc-max-width--xl rc-main">
|
||||
<div class="usersearch">
|
||||
<div class="usercontentshow" ref="usercontent">
|
||||
@ -310,6 +311,7 @@
|
||||
import Myheader from "~/components/header.vue";
|
||||
import MyFooter from '~/components/rc-footer.vue'
|
||||
import FixRight from "~/components/fixed-right.vue";
|
||||
import tabs from "~/components/tabs.vue";
|
||||
import {
|
||||
userstype,
|
||||
biaome,
|
||||
@ -320,21 +322,27 @@ import {
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
value: "",
|
||||
isLoading: false,
|
||||
userstype: [],
|
||||
activeIndex: "0",
|
||||
allacindex: 0,
|
||||
userishwo: true,
|
||||
userishwo4: true,
|
||||
userserachlist: [
|
||||
{
|
||||
categoryName: [], //专区
|
||||
tagUsedAge: [], //年龄
|
||||
tagFunction: [], //功能
|
||||
tagBreed: [], //品种
|
||||
},
|
||||
],
|
||||
crumbs:[
|
||||
{
|
||||
path:'/productdetails/productlist/',
|
||||
title:'产品列表',
|
||||
}
|
||||
],
|
||||
value: "",
|
||||
isLoading: false,
|
||||
userstype: [],
|
||||
activeIndex: "0",
|
||||
allacindex: 0,
|
||||
userishwo: true,
|
||||
userishwo4: true,
|
||||
userserachlist: [
|
||||
{
|
||||
categoryName: [], //专区
|
||||
tagUsedAge: [], //年龄
|
||||
tagFunction: [], //功能
|
||||
tagBreed: [], //品种
|
||||
},
|
||||
],
|
||||
activeIndex1: 0,
|
||||
activeIndexa: "-1",
|
||||
dialogInfo1: false,
|
||||
@ -477,7 +485,8 @@ export default {
|
||||
components: {
|
||||
Myheader,
|
||||
MyFooter,
|
||||
FixRight
|
||||
FixRight,
|
||||
tabs
|
||||
},
|
||||
created() {
|
||||
this.routeParams=this.$route.query;
|
||||
|
Loading…
Reference in New Issue
Block a user