@tongfun/tf-widget 0.1.11 → 0.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<div class="tf-labelbar">
|
|
3
3
|
<div class="close-menu">
|
|
4
4
|
<div
|
|
5
|
-
:class="
|
|
5
|
+
:class="closeMenu ? 'open-menu-icon': 'close-menu-icon'"
|
|
6
6
|
src=""
|
|
7
7
|
alt=""
|
|
8
8
|
title="隐藏列表"
|
|
@@ -74,13 +74,19 @@ import TfRotateBox from './tf-rotate-box.vue'
|
|
|
74
74
|
import TfRightMenu from './tf-right-menu'
|
|
75
75
|
export default {
|
|
76
76
|
name: 'TfLaberBar',
|
|
77
|
+
params: {
|
|
78
|
+
routeBase: {
|
|
79
|
+
default: null,
|
|
80
|
+
type: String
|
|
81
|
+
}
|
|
82
|
+
},
|
|
77
83
|
components: {
|
|
78
84
|
TfRotateBox,
|
|
79
85
|
TfRightMenu
|
|
80
86
|
},
|
|
81
87
|
data () {
|
|
82
88
|
return {
|
|
83
|
-
|
|
89
|
+
closeMenu: false,
|
|
84
90
|
activePath: '/',
|
|
85
91
|
tagList: [],
|
|
86
92
|
rightMenuLeft: 0,
|
|
@@ -91,9 +97,7 @@ export default {
|
|
|
91
97
|
watch: {
|
|
92
98
|
$route: {
|
|
93
99
|
handler: function (newValue) {
|
|
94
|
-
|
|
95
|
-
if (newValue && newValue.matched[0]?.meta.base === base) {
|
|
96
|
-
|
|
100
|
+
if (newValue && newValue.matched[0]?.meta.base === this.routeBase) {
|
|
97
101
|
const { meta, path, name, params, query } = newValue
|
|
98
102
|
if (!path) return
|
|
99
103
|
const obj = {
|
|
@@ -131,8 +135,8 @@ export default {
|
|
|
131
135
|
},
|
|
132
136
|
methods: {
|
|
133
137
|
changeMenuState () {
|
|
134
|
-
this.
|
|
135
|
-
this.$emit('changeMenuState', this.
|
|
138
|
+
this.closeMenu = !this.closeMenu
|
|
139
|
+
this.$emit('changeMenuState', this.closeMenu)
|
|
136
140
|
},
|
|
137
141
|
/**
|
|
138
142
|
* @description tag右键点击事件
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
/>
|
|
7
7
|
<div class="tf-layout-subject">
|
|
8
8
|
<TfLaberBar
|
|
9
|
+
:routeBase="routeBase"
|
|
9
10
|
@setCache="setCache"
|
|
10
11
|
@changeMenuState="changeMenuState"
|
|
11
12
|
@deleteCache="deleteCache"
|
|
@@ -34,6 +35,10 @@ export default {
|
|
|
34
35
|
default: function () {
|
|
35
36
|
return []
|
|
36
37
|
}
|
|
38
|
+
},
|
|
39
|
+
routeBase: {
|
|
40
|
+
default: null,
|
|
41
|
+
type: String
|
|
37
42
|
}
|
|
38
43
|
},
|
|
39
44
|
data () {
|
|
@@ -45,7 +50,7 @@ export default {
|
|
|
45
50
|
}
|
|
46
51
|
},
|
|
47
52
|
methods: {
|
|
48
|
-
changeMenuState(state) {
|
|
53
|
+
changeMenuState (state) {
|
|
49
54
|
this.menuState = state
|
|
50
55
|
},
|
|
51
56
|
setCache (value) {
|