@tongfun/tf-widget 0.1.7 → 0.1.8-beta
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.
- package/.browserslistrc +3 -3
- package/.editorconfig +5 -5
- package/.eslintrc.js +17 -17
- package/README.md +36 -8
- package/dist/css/chunk-vendors.a16c4353.css +1 -0
- package/dist/css/index.f35459d8.css +1 -0
- package/dist/fonts/element-icons.535877f5.woff +0 -0
- package/dist/fonts/element-icons.732389de.ttf +0 -0
- package/dist/js/chunk-vendors.c86d3e60.js +41 -0
- package/dist/js/index.36f35563.js +1 -0
- package/lib/tf-widget.common.js +1022 -2
- package/lib/tf-widget.css +1 -1
- package/lib/tf-widget.umd.js +1022 -2
- package/lib/tf-widget.umd.min.js +3 -3
- package/package/tf-layout/README.md +2 -0
- package/package/tf-layout/index.js +8 -0
- package/package/tf-layout/src/components/tf-labelbar.vue +361 -0
- package/package/tf-layout/src/components/tf-menu.vue +167 -0
- package/package/tf-layout/src/components/tf-right-menu.vue +89 -0
- package/package/tf-layout/src/components/tf-rotate-box.vue +50 -0
- package/package/tf-layout/src/tf-layout.vue +104 -0
- package/package.json +1 -1
- package/postinstall.js +10 -10
- package/src/index.js +5 -3
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="tf-layout">
|
|
3
|
+
<TfMenu :menu-info="menuInfo" />
|
|
4
|
+
<div class="tf-layout-subject">
|
|
5
|
+
<TfLaberBar @setCache="setCache" @deleteCache="deleteCache" />
|
|
6
|
+
<div class="tf-layout-subject-content">
|
|
7
|
+
<keep-alive :include="secondCacheArray">
|
|
8
|
+
<router-view />
|
|
9
|
+
</keep-alive>
|
|
10
|
+
</div>
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script>
|
|
16
|
+
import TfMenu from './components/tf-menu'
|
|
17
|
+
import TfLaberBar from './components/tf-labelbar'
|
|
18
|
+
export default {
|
|
19
|
+
name: 'TfLayout',
|
|
20
|
+
components: {
|
|
21
|
+
TfMenu,
|
|
22
|
+
TfLaberBar
|
|
23
|
+
},
|
|
24
|
+
props: {
|
|
25
|
+
menuInfo: {
|
|
26
|
+
type: Array,
|
|
27
|
+
default: function () {
|
|
28
|
+
return []
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
data () {
|
|
33
|
+
return {
|
|
34
|
+
cacheMap: new Map(),
|
|
35
|
+
secondCacheArray: [],
|
|
36
|
+
thirdCacheArr: []
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
methods: {
|
|
40
|
+
setCache (value) {
|
|
41
|
+
this.cacheMap.set(value[2] || value[1], value[1])
|
|
42
|
+
this.initCacheArr()
|
|
43
|
+
},
|
|
44
|
+
initCacheArr () {
|
|
45
|
+
this.secondCacheArray.push(
|
|
46
|
+
...this.arrayDiff([...this.cacheMap.values()], this.secondCacheArray)
|
|
47
|
+
)
|
|
48
|
+
this.thirdCacheArr.push(
|
|
49
|
+
...this.arrayDiff([...this.cacheMap.keys()], this.thirdCacheArr)
|
|
50
|
+
)
|
|
51
|
+
this.$emit('setSecondCache', this.secondCacheArray)
|
|
52
|
+
this.$emit('setThirdCache', this.thirdCacheArr)
|
|
53
|
+
},
|
|
54
|
+
arrayDiff (arr, arrRaw) {
|
|
55
|
+
if (Array.isArray(arr)) {
|
|
56
|
+
return arr.filter((i) => {
|
|
57
|
+
return arrRaw.indexOf(i) < 0
|
|
58
|
+
})
|
|
59
|
+
}
|
|
60
|
+
return []
|
|
61
|
+
},
|
|
62
|
+
deleteCache (value) {
|
|
63
|
+
if (Array.isArray(value)) {
|
|
64
|
+
value.forEach((item) => {
|
|
65
|
+
console.log(item)
|
|
66
|
+
this.cacheMap.delete(item[2] || item[1])
|
|
67
|
+
this.thirdCacheArr.splice(
|
|
68
|
+
this.thirdCacheArr.indexOf(item[2] || item[1]),
|
|
69
|
+
1
|
|
70
|
+
)
|
|
71
|
+
if ([...this.cacheMap.values()].indexOf(item[1]) === -1) {
|
|
72
|
+
this.secondCacheArray.splice(
|
|
73
|
+
this.secondCacheArray.indexOf(item[2]),
|
|
74
|
+
1
|
|
75
|
+
)
|
|
76
|
+
}
|
|
77
|
+
console.log(this.cacheMap.get(item[2] || item[1]))
|
|
78
|
+
})
|
|
79
|
+
this.$emit('setSecondCache', this.secondCacheArray)
|
|
80
|
+
this.$emit('setThirdCache', this.thirdCacheArr)
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
</script>
|
|
86
|
+
|
|
87
|
+
<style lang="less" scoped>
|
|
88
|
+
.tf-layout {
|
|
89
|
+
height: 100vh;
|
|
90
|
+
width: 100vw;
|
|
91
|
+
display: flex;
|
|
92
|
+
.tf-layout-subject {
|
|
93
|
+
flex: 1;
|
|
94
|
+
height: 100%;
|
|
95
|
+
width: 100vw;
|
|
96
|
+
.tf-layout-subject-content {
|
|
97
|
+
height: calc(100% - 35px);
|
|
98
|
+
background: rgb(241, 241, 241);
|
|
99
|
+
box-sizing: border-box;
|
|
100
|
+
padding: 5px 0 0 0;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
</style>
|
package/package.json
CHANGED
package/postinstall.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
const BANNER = '\u001B[96mThank you for using tf-widget for polyfilling JavaScript standard library!\u001B[0m\n\n' +
|
|
3
|
-
'\u001B[96mWe need the best of you! Come and join us\n\n' +
|
|
4
|
-
'\u001B[96mWe are waiting for you\n'
|
|
5
|
-
|
|
6
|
-
function showBanner () {
|
|
7
|
-
console.log(BANNER)
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
showBanner()
|
|
1
|
+
|
|
2
|
+
const BANNER = '\u001B[96mThank you for using tf-widget for polyfilling JavaScript standard library!\u001B[0m\n\n' +
|
|
3
|
+
'\u001B[96mWe need the best of you! Come and join us\n\n' +
|
|
4
|
+
'\u001B[96mWe are waiting for you\n'
|
|
5
|
+
|
|
6
|
+
function showBanner () {
|
|
7
|
+
console.log(BANNER)
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
showBanner()
|
package/src/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
|
|
2
2
|
import TfWidget from '../package/tf-widget'
|
|
3
3
|
import SvgIcon from '../package/svg-icon'
|
|
4
|
-
|
|
4
|
+
import TfLayout from '../package/tf-layout'
|
|
5
5
|
const components = [
|
|
6
6
|
TfWidget,
|
|
7
|
-
SvgIcon
|
|
7
|
+
SvgIcon,
|
|
8
|
+
TfLayout
|
|
8
9
|
]
|
|
9
10
|
|
|
10
11
|
const install = function (Vue) {
|
|
@@ -16,5 +17,6 @@ const install = function (Vue) {
|
|
|
16
17
|
export default {
|
|
17
18
|
install,
|
|
18
19
|
TfWidget,
|
|
19
|
-
SvgIcon
|
|
20
|
+
SvgIcon,
|
|
21
|
+
TfLayout
|
|
20
22
|
}
|