@bsgoal/common 1.9.2 → 1.9.3
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/package.json
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
* @Author: canlong.shen
|
|
3
3
|
* @Date: 2023-04-14 10:50:11
|
|
4
4
|
* @LastEditors: canlong.shen
|
|
5
|
-
* @LastEditTime: 2023-05-22 15:
|
|
5
|
+
* @LastEditTime: 2023-05-22 15:55:30
|
|
6
6
|
* @FilePath: \common\src\directives\directiveBase.js
|
|
7
7
|
* @Description: 常用的公共指令
|
|
8
8
|
*
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
let timeoutID = null
|
|
12
11
|
const autoAlign = (el) => {
|
|
12
|
+
let timeoutID = null
|
|
13
13
|
//指令所在组件的 VNode 及其子 VNode 全部更新后调用。
|
|
14
14
|
/**
|
|
15
15
|
* label集合
|
|
@@ -21,7 +21,6 @@ const autoAlign = (el) => {
|
|
|
21
21
|
* 计算lable长度
|
|
22
22
|
*/
|
|
23
23
|
const calcLabelWidth = (elInfoList = []) => {
|
|
24
|
-
console.log('elInfoList',elInfoList);
|
|
25
24
|
const widthList = elInfoList.map((mi) => mi.width)
|
|
26
25
|
const maxWidth = Math.max(...widthList)
|
|
27
26
|
elInfoList.forEach((fi) => {
|
|
@@ -59,11 +58,11 @@ const autoAlign = (el) => {
|
|
|
59
58
|
clearTimeout(timeoutID)
|
|
60
59
|
}
|
|
61
60
|
// 开始计算
|
|
62
|
-
|
|
61
|
+
timeoutID = setTimeout(() => {
|
|
63
62
|
sortingLabelEl()
|
|
64
63
|
calcLabelWidth(labelElLeftList)
|
|
65
64
|
calcLabelWidth(labelElRightList)
|
|
66
|
-
},
|
|
65
|
+
}, 50)
|
|
67
66
|
}
|
|
68
67
|
|
|
69
68
|
export default {
|
|
@@ -72,7 +71,6 @@ export default {
|
|
|
72
71
|
*/
|
|
73
72
|
align: {
|
|
74
73
|
created(el) {
|
|
75
|
-
console.log('el',el);
|
|
76
74
|
window.addEventListener('resize', () => {
|
|
77
75
|
autoAlign(el)
|
|
78
76
|
})
|