1
|
<template>
|
1
|
<template>
|
2
|
<LayoutBody>
|
2
|
<LayoutBody>
|
3
|
<LayoutTab>
|
3
|
<LayoutTab>
|
4
|
- <Tabs value="name1" @on-click="switchTab">
|
4
|
+ <Tabs :value="activate" animated="false" @on-click="switchTab">
|
5
|
<Tab-pane :label="tab1.label" :name="tab1.name"></Tab-pane>
|
5
|
<Tab-pane :label="tab1.label" :name="tab1.name"></Tab-pane>
|
6
|
<Tab-pane :label="tab2.label" :name="tab2.name"></Tab-pane>
|
6
|
<Tab-pane :label="tab2.label" :name="tab2.name"></Tab-pane>
|
7
|
<Tab-pane :label="tab3.label" :name="tab3.name"></Tab-pane>
|
7
|
<Tab-pane :label="tab3.label" :name="tab3.name"></Tab-pane>
|
|
@@ -27,10 +27,24 @@ export default { |
|
@@ -27,10 +27,24 @@ export default { |
27
|
tab3: {
|
27
|
tab3: {
|
28
|
label: '发货物流表',
|
28
|
label: '发货物流表',
|
29
|
name: 'express'
|
29
|
name: 'express'
|
30
|
- }
|
30
|
+ },
|
|
|
31
|
+ activate: ''
|
31
|
};
|
32
|
};
|
32
|
},
|
33
|
},
|
33
|
created() {
|
34
|
created() {
|
|
|
35
|
+ const path = this.$route.path;
|
|
|
36
|
+ const children = ['undone', 'done', 'express'];
|
|
|
37
|
+
|
|
|
38
|
+ _.each(children, v => {
|
|
|
39
|
+ const reg = new RegExp(`/${v}`);
|
|
|
40
|
+
|
|
|
41
|
+ console.log(reg.test(path))
|
|
|
42
|
+
|
|
|
43
|
+ if(reg.test(path)) {
|
|
|
44
|
+ this.activate = v;
|
|
|
45
|
+ return false;
|
|
|
46
|
+ }
|
|
|
47
|
+ });
|
34
|
},
|
48
|
},
|
35
|
methods: {
|
49
|
methods: {
|
36
|
switchTab(name) {
|
50
|
switchTab(name) {
|