kui-vue 3.6.0 → 3.6.1
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/{readme.md → README.md} +4 -10
- package/components/button/demo/group.md +1 -1
- package/components/card/card.jsx +1 -1
- package/components/checkbox/checkboxGroup.jsx +4 -4
- package/components/checkbox/demo/group.md +17 -6
- package/components/checkbox/styles/index.less +4 -11
- package/components/colorPicker/colorpicker.jsx +5 -6
- package/components/colorPicker/demo/customTrigger.md +2 -2
- package/components/colorPicker/demo/mode.md +1 -4
- package/components/datePicker/datepicker.jsx +19 -11
- package/components/datePicker/demo/basic.md +15 -6
- package/components/datePicker/demo/lang.md +2 -2
- package/components/drawer/drawer.jsx +2 -2
- package/components/dropdown/dropdown.jsx +9 -40
- package/components/form/demo/valid.md +1 -0
- package/components/image/image.jsx +1 -0
- package/components/input/index.md +1 -1
- package/components/inputNumber/demo/basic.md +12 -5
- package/components/inputNumber/demo/format.md +0 -5
- package/components/inputNumber/index.md +1 -1
- package/components/inputNumber/inputNumber.jsx +3 -5
- package/components/inputNumber/styles/index.less +64 -64
- package/components/menu/submenu.jsx +5 -5
- package/components/page/page.jsx +0 -1
- package/components/popconfirm/popconfirm.jsx +4 -4
- package/components/poptip/poptip.jsx +4 -4
- package/components/radio/demo/group.md +16 -6
- package/components/radio/demo/radioButton.md +3 -8
- package/components/radio/radioGroup.jsx +8 -11
- package/components/radio/styles/index.less +10 -21
- package/components/select/demo/basic.md +16 -7
- package/components/select/demo/filterable.md +4 -2
- package/components/select/index.md +23 -22
- package/components/select/option.jsx +7 -3
- package/components/select/select.jsx +43 -36
- package/components/select/styles/index.less +1 -0
- package/components/slider/demo/basic.md +2 -1
- package/components/slider/demo/withNumber.md +3 -3
- package/components/slider/slider.jsx +0 -25
- package/components/space/styles/index.less +3 -1
- package/components/styles/sys.less +3 -0
- package/components/switch/switch.jsx +15 -5
- package/components/table/styles/index.less +10 -5
- package/components/table/table.jsx +98 -69
- package/components/tooltip/tooltip.jsx +3 -3
- package/components/treeselect/demo/size.md +2 -2
- package/components/treeselect/treeselect.jsx +15 -20
- package/components/utils/placement.js +137 -126
- package/dist/k-ui.cjs.js +2 -2
- package/dist/k-ui.css +2 -2
- package/dist/k-ui.d.ts +118 -115
- package/dist/k-ui.esm.js +2 -2
- package/dist/k-ui.umd.js +2 -2
- package/dist/locale/de.js +1 -1
- package/dist/locale/el.js +1 -1
- package/dist/locale/en.js +1 -1
- package/dist/locale/fr.js +1 -1
- package/dist/locale/it.js +1 -1
- package/dist/locale/ja.js +1 -1
- package/dist/locale/ko.js +1 -1
- package/dist/locale/ru.js +1 -1
- package/dist/locale/th.js +1 -1
- package/dist/locale/uk.js +1 -1
- package/dist/locale/vi.js +1 -1
- package/dist/locale/zh-CN.js +1 -1
- package/dist/locale/zh-TW.js +1 -1
- package/package.json +5 -5
- package/test/i18n@8.x.html +6 -2
- package/types/image/KImage.d.ts +1 -0
- package/types/index.d.ts +10 -10
- package/types/switch/Switch.d.ts +2 -0
- package/components/steps/index.js +0 -4
- package/components/steps/step.vue +0 -82
- package/components/steps/steps.vue +0 -68
- package/components/steps/styles/index.less +0 -198
|
@@ -35,7 +35,7 @@ const Tooltip = defineComponent({
|
|
|
35
35
|
const rendered = ref(ps.show);
|
|
36
36
|
const visible = ref(ps.show);
|
|
37
37
|
const refPopper = ref();
|
|
38
|
-
const
|
|
38
|
+
const refSelection = ref();
|
|
39
39
|
const left = ref(0);
|
|
40
40
|
const top = ref(0);
|
|
41
41
|
const currentPlacement = ref(ps.placement);
|
|
@@ -45,7 +45,7 @@ const Tooltip = defineComponent({
|
|
|
45
45
|
const updatePosition = () => {
|
|
46
46
|
nextTick(() => {
|
|
47
47
|
setPlacement({
|
|
48
|
-
|
|
48
|
+
refSelection,
|
|
49
49
|
refPopper,
|
|
50
50
|
currentPlacement,
|
|
51
51
|
transOrigin,
|
|
@@ -109,7 +109,7 @@ const Tooltip = defineComponent({
|
|
|
109
109
|
},
|
|
110
110
|
];
|
|
111
111
|
const wpProps = {
|
|
112
|
-
ref:
|
|
112
|
+
ref: refSelection,
|
|
113
113
|
on: {
|
|
114
114
|
touchstart: mouseEnter,
|
|
115
115
|
touchmove: updatePosition,
|
|
@@ -84,7 +84,6 @@ const TreeSelect = defineComponent({
|
|
|
84
84
|
: injectedLocale;
|
|
85
85
|
});
|
|
86
86
|
|
|
87
|
-
const labelText = ref([]);
|
|
88
87
|
const visible = ref(false);
|
|
89
88
|
const rendered = ref(false);
|
|
90
89
|
const currentValue = ref(
|
|
@@ -99,7 +98,7 @@ const TreeSelect = defineComponent({
|
|
|
99
98
|
const hasSearchEvent = "search" in listeners;
|
|
100
99
|
const refPopper = ref();
|
|
101
100
|
const transOrigin = ref("bottom");
|
|
102
|
-
const
|
|
101
|
+
const refSelection = ref();
|
|
103
102
|
const left = ref(0);
|
|
104
103
|
const top = ref(0);
|
|
105
104
|
const currentPlacement = ref(ps.placement);
|
|
@@ -122,7 +121,6 @@ const TreeSelect = defineComponent({
|
|
|
122
121
|
(v) => {
|
|
123
122
|
currentValue.value = ps.multiple ? v || [] : isEmpty(v) ? [] : [v];
|
|
124
123
|
updatePosition();
|
|
125
|
-
updateLabel();
|
|
126
124
|
}
|
|
127
125
|
);
|
|
128
126
|
|
|
@@ -132,9 +130,9 @@ const TreeSelect = defineComponent({
|
|
|
132
130
|
|
|
133
131
|
const updatePosition = () => {
|
|
134
132
|
nextTick(() => {
|
|
135
|
-
minWidth.value =
|
|
133
|
+
minWidth.value = refSelection.value?.offsetWidth;
|
|
136
134
|
setPlacement({
|
|
137
|
-
|
|
135
|
+
refSelection,
|
|
138
136
|
refPopper,
|
|
139
137
|
currentPlacement,
|
|
140
138
|
transOrigin,
|
|
@@ -146,13 +144,12 @@ const TreeSelect = defineComponent({
|
|
|
146
144
|
|
|
147
145
|
onMounted(() => {
|
|
148
146
|
nextTick(() => {
|
|
149
|
-
minWidth.value =
|
|
150
|
-
updateLabel();
|
|
147
|
+
minWidth.value = refSelection.value?.offsetWidth;
|
|
151
148
|
});
|
|
152
149
|
});
|
|
153
150
|
|
|
154
151
|
const outsideClick = (e) => {
|
|
155
|
-
const ctx =
|
|
152
|
+
const ctx = refSelection.value?.$el || refSelection.value;
|
|
156
153
|
if (
|
|
157
154
|
refPopper.value &&
|
|
158
155
|
!refPopper.value.contains(e.target) &&
|
|
@@ -214,13 +211,11 @@ const TreeSelect = defineComponent({
|
|
|
214
211
|
const removeTag = (e, index) => {
|
|
215
212
|
if (ps.disabled) return;
|
|
216
213
|
currentValue.value.splice(index, 1);
|
|
217
|
-
labelText.value.splice(index, 1);
|
|
218
214
|
e.stopPropagation();
|
|
219
215
|
updatePosition();
|
|
220
216
|
};
|
|
221
217
|
const onClear = (e) => {
|
|
222
218
|
currentValue.value = [];
|
|
223
|
-
labelText.value = [];
|
|
224
219
|
emit("input", ps.multiple ? [] : "");
|
|
225
220
|
emit("change", ps.multiple ? [] : "");
|
|
226
221
|
|
|
@@ -263,12 +258,12 @@ const TreeSelect = defineComponent({
|
|
|
263
258
|
}
|
|
264
259
|
}
|
|
265
260
|
};
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
labelText.value = optionsData.value
|
|
261
|
+
const labelText = computed(() => {
|
|
262
|
+
return optionsData.value
|
|
269
263
|
.filter((item) => currentValue.value.includes(item.key))
|
|
270
264
|
.map((item) => item.title);
|
|
271
|
-
};
|
|
265
|
+
});
|
|
266
|
+
|
|
272
267
|
const optionsData = computed(() => {
|
|
273
268
|
const options = buildTree({
|
|
274
269
|
data: ps.treeData,
|
|
@@ -317,10 +312,8 @@ const TreeSelect = defineComponent({
|
|
|
317
312
|
if (currentValue.value?.indexOf(value) >= 0) {
|
|
318
313
|
selected = false;
|
|
319
314
|
currentValue.value = currentValue.value.filter((v) => v !== value);
|
|
320
|
-
labelText.value = labelText.value.filter((v) => v !== label);
|
|
321
315
|
} else {
|
|
322
316
|
currentValue.value.push(value);
|
|
323
|
-
labelText.value.push(label);
|
|
324
317
|
}
|
|
325
318
|
|
|
326
319
|
updatePosition();
|
|
@@ -331,7 +324,6 @@ const TreeSelect = defineComponent({
|
|
|
331
324
|
}
|
|
332
325
|
} else {
|
|
333
326
|
currentValue.value = [value];
|
|
334
|
-
labelText.value = [label];
|
|
335
327
|
visible.value = false;
|
|
336
328
|
clearQuery();
|
|
337
329
|
}
|
|
@@ -374,7 +366,6 @@ const TreeSelect = defineComponent({
|
|
|
374
366
|
ps.multiple &&
|
|
375
367
|
currentValue.value.length > 0
|
|
376
368
|
) {
|
|
377
|
-
labelText.value = labelText.value.slice(0, -1);
|
|
378
369
|
currentValue.value = currentValue.value.slice(0, -1);
|
|
379
370
|
emit("input", currentValue.value);
|
|
380
371
|
// emit("update:value", currentValue.value);
|
|
@@ -558,7 +549,11 @@ const TreeSelect = defineComponent({
|
|
|
558
549
|
},
|
|
559
550
|
];
|
|
560
551
|
const clearNode = showClear.value ? (
|
|
561
|
-
<Icon
|
|
552
|
+
<Icon
|
|
553
|
+
class="k-tree-select-clearable"
|
|
554
|
+
type={CloseCircle}
|
|
555
|
+
onClick={onClear}
|
|
556
|
+
/>
|
|
562
557
|
) : null;
|
|
563
558
|
|
|
564
559
|
return (
|
|
@@ -570,7 +565,7 @@ const TreeSelect = defineComponent({
|
|
|
570
565
|
onClick={toggle}
|
|
571
566
|
onFocus={() => (ctxFocused.value = true)}
|
|
572
567
|
onBlur={() => (ctxFocused.value = false)}
|
|
573
|
-
ref={
|
|
568
|
+
ref={refSelection}
|
|
574
569
|
>
|
|
575
570
|
{icon ? <Icon type={icon} class="k-tree-select-icon" /> : null}
|
|
576
571
|
<div class="k-tree-select-selection">{childNode}</div>
|
|
@@ -1,139 +1,150 @@
|
|
|
1
1
|
export function setPlacement({
|
|
2
|
-
|
|
2
|
+
refSelection,
|
|
3
3
|
refPopper,
|
|
4
4
|
currentPlacement,
|
|
5
|
+
position = null,
|
|
5
6
|
transOrigin,
|
|
6
7
|
top,
|
|
7
8
|
left,
|
|
8
9
|
offset = 3,
|
|
9
10
|
}) {
|
|
10
|
-
if (!
|
|
11
|
-
|
|
12
|
-
let
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
11
|
+
if (!refPopper.value) return;
|
|
12
|
+
|
|
13
|
+
let rect = null;
|
|
14
|
+
|
|
15
|
+
if (
|
|
16
|
+
position &&
|
|
17
|
+
typeof position.x === "number" &&
|
|
18
|
+
typeof position.y === "number"
|
|
19
|
+
) {
|
|
20
|
+
// 鼠标定位:构造 0x0 虚拟矩形
|
|
21
|
+
rect = {
|
|
22
|
+
width: 0,
|
|
23
|
+
height: 0,
|
|
24
|
+
top: position.y,
|
|
25
|
+
bottom: position.y,
|
|
26
|
+
left: position.x,
|
|
27
|
+
right: position.x,
|
|
28
|
+
};
|
|
29
|
+
} else if (refSelection && refSelection.value) {
|
|
30
|
+
// 元素定位
|
|
31
|
+
const selection = refSelection.value.$el || refSelection.value;
|
|
32
|
+
rect = selection.getBoundingClientRect();
|
|
33
|
+
} else {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const pickerH = refPopper.value.offsetHeight;
|
|
38
|
+
const pickerW = refPopper.value.offsetWidth;
|
|
39
|
+
const { clientHeight, clientWidth, scrollTop, scrollLeft } =
|
|
40
|
+
document.documentElement;
|
|
41
|
+
|
|
42
|
+
const check = {
|
|
43
|
+
// 主轴空间
|
|
44
|
+
top: rect.top > pickerH + offset,
|
|
45
|
+
bottom: clientHeight - rect.bottom > pickerH + offset,
|
|
46
|
+
left: rect.left > pickerW + offset,
|
|
47
|
+
right: clientWidth - rect.right > pickerW + offset,
|
|
48
|
+
|
|
49
|
+
// 交叉轴空间 (仅检测是否能贴边放下)
|
|
50
|
+
// alignLeft: 左对齐(向右延伸)空间是否足够
|
|
51
|
+
alignLeft: clientWidth - rect.left > pickerW,
|
|
52
|
+
// alignRight: 右对齐(向左延伸)空间是否足够
|
|
53
|
+
alignRight: rect.right > pickerW,
|
|
54
|
+
// alignTop: 顶对齐(向下延伸)空间是否足够
|
|
55
|
+
alignTop: clientHeight - rect.top > pickerH,
|
|
56
|
+
// alignBottom: 底对齐(向上延伸)空间是否足够
|
|
57
|
+
alignBottom: rect.bottom > pickerH,
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
let [side, align] = currentPlacement.value.split("-");
|
|
61
|
+
|
|
62
|
+
if (!align) {
|
|
63
|
+
if (side === "top" || side === "bottom") align = "left";
|
|
64
|
+
else if (side === "left" || side === "right") align = "top";
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// 主轴翻转 (Main Axis Flip)
|
|
68
|
+
if (side === "top" && !check.top && check.bottom) side = "bottom";
|
|
69
|
+
else if (side === "bottom" && !check.bottom && check.top) side = "top";
|
|
70
|
+
else if (side === "left" && !check.left && check.right) side = "right";
|
|
71
|
+
else if (side === "right" && !check.right && check.left) side = "left";
|
|
72
|
+
|
|
73
|
+
// 交叉轴对齐翻转 (Cross Axis Flip) - 严格互斥,不走居中
|
|
74
|
+
if (side === "top" || side === "bottom") {
|
|
75
|
+
// 如果左对齐放不下,且右对齐放得下 -> 切右
|
|
76
|
+
if (align === "left" && !check.alignLeft && check.alignRight)
|
|
77
|
+
align = "right";
|
|
78
|
+
// 如果右对齐放不下,且左对齐放得下 -> 切左
|
|
79
|
+
else if (align === "right" && !check.alignRight && check.alignLeft)
|
|
80
|
+
align = "left";
|
|
81
|
+
} else if (side === "left" || side === "right") {
|
|
82
|
+
// 如果顶对齐放不下,且底对齐放得下 -> 切底
|
|
83
|
+
if (align === "top" && !check.alignTop && check.alignBottom)
|
|
84
|
+
align = "bottom";
|
|
85
|
+
// 如果底对齐放不下,且顶对齐放得下 -> 切顶
|
|
86
|
+
else if (align === "bottom" && !check.alignBottom && check.alignTop)
|
|
87
|
+
align = "top";
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const finalPlacement = `${side}-${align}`;
|
|
91
|
+
|
|
92
|
+
let calcTop = 0;
|
|
93
|
+
let calcLeft = 0;
|
|
94
|
+
let originX = "center";
|
|
95
|
+
let originY = "center";
|
|
96
|
+
|
|
97
|
+
// Y 轴计算
|
|
98
|
+
if (side === "top") {
|
|
99
|
+
calcTop = rect.top - pickerH - offset;
|
|
100
|
+
originY = "bottom";
|
|
101
|
+
} else if (side === "bottom") {
|
|
102
|
+
calcTop = rect.bottom + offset;
|
|
103
|
+
originY = "top";
|
|
104
|
+
} else {
|
|
105
|
+
// side 是 left/right
|
|
106
|
+
if (align === "top") {
|
|
107
|
+
calcTop = rect.top;
|
|
108
|
+
originY = "top";
|
|
109
|
+
} else {
|
|
110
|
+
// 只有 bottom 可选,居中已被移除
|
|
111
|
+
calcTop = rect.bottom - pickerH;
|
|
112
|
+
originY = "bottom";
|
|
42
113
|
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// X 轴计算
|
|
117
|
+
if (side === "left") {
|
|
118
|
+
calcLeft = rect.left - pickerW - offset;
|
|
119
|
+
originX = "right";
|
|
120
|
+
} else if (side === "right") {
|
|
121
|
+
calcLeft = rect.right + offset;
|
|
122
|
+
originX = "left";
|
|
123
|
+
} else {
|
|
124
|
+
// side 是 top/bottom
|
|
125
|
+
if (align === "left") {
|
|
126
|
+
calcLeft = rect.left;
|
|
127
|
+
originX = "left";
|
|
128
|
+
} else {
|
|
129
|
+
// 只有 right 可选
|
|
130
|
+
calcLeft = rect.right - pickerW;
|
|
131
|
+
originX = "right";
|
|
46
132
|
}
|
|
47
133
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
transOrigin.value = "left bottom";
|
|
64
|
-
break;
|
|
65
|
-
case "top-right":
|
|
66
|
-
top.value = selectionRect.top - pickerHeight - offset + scrollTop;
|
|
67
|
-
left.value =
|
|
68
|
-
selectionRect.left + selectionRect.width - pickerWidth + scrollLeft;
|
|
69
|
-
transOrigin.value = "right bottom";
|
|
70
|
-
break;
|
|
71
|
-
case "bottom":
|
|
72
|
-
top.value = selectionRect.top + selectionRect.height + offset + scrollTop;
|
|
73
|
-
left.value =
|
|
74
|
-
selectionRect.left +
|
|
75
|
-
(selectionRect.width - pickerWidth) / 2 +
|
|
76
|
-
scrollLeft;
|
|
77
|
-
transOrigin.value = "center top";
|
|
78
|
-
break;
|
|
79
|
-
case "bottom-left":
|
|
80
|
-
top.value = selectionRect.top + selectionRect.height + offset + scrollTop;
|
|
81
|
-
left.value = selectionRect.left + scrollLeft;
|
|
82
|
-
transOrigin.value = "left top";
|
|
83
|
-
break;
|
|
84
|
-
case "bottom-right":
|
|
85
|
-
top.value = selectionRect.top + selectionRect.height + offset + scrollTop;
|
|
86
|
-
left.value =
|
|
87
|
-
selectionRect.left + selectionRect.width - pickerWidth + scrollLeft;
|
|
88
|
-
transOrigin.value = "right top";
|
|
89
|
-
break;
|
|
90
|
-
case "left":
|
|
91
|
-
top.value =
|
|
92
|
-
selectionRect.top +
|
|
93
|
-
(selectionRect.height - pickerHeight) / 2 +
|
|
94
|
-
scrollTop;
|
|
95
|
-
left.value = selectionRect.left - pickerWidth - offset + scrollLeft;
|
|
96
|
-
transOrigin.value = "right center";
|
|
97
|
-
break;
|
|
98
|
-
case "left-top":
|
|
99
|
-
top.value = selectionRect.top + scrollTop;
|
|
100
|
-
left.value = selectionRect.left - pickerWidth - offset + scrollLeft;
|
|
101
|
-
transOrigin.value = "right top";
|
|
102
|
-
break;
|
|
103
|
-
case "left-bottom":
|
|
104
|
-
top.value =
|
|
105
|
-
selectionRect.top + selectionRect.height - pickerHeight + scrollTop;
|
|
106
|
-
left.value = selectionRect.left - pickerWidth - offset + scrollLeft;
|
|
107
|
-
transOrigin.value = "right bottom";
|
|
108
|
-
break;
|
|
109
|
-
case "right":
|
|
110
|
-
top.value =
|
|
111
|
-
selectionRect.top +
|
|
112
|
-
(selectionRect.height - pickerHeight) / 2 +
|
|
113
|
-
scrollTop;
|
|
114
|
-
left.value =
|
|
115
|
-
selectionRect.left + selectionRect.width + offset + scrollLeft;
|
|
116
|
-
transOrigin.value = "left center";
|
|
117
|
-
break;
|
|
118
|
-
case "right-top":
|
|
119
|
-
top.value = selectionRect.top + scrollTop;
|
|
120
|
-
left.value =
|
|
121
|
-
selectionRect.left + selectionRect.width + offset + scrollLeft;
|
|
122
|
-
transOrigin.value = "left top";
|
|
123
|
-
break;
|
|
124
|
-
case "right-bottom":
|
|
125
|
-
top.value =
|
|
126
|
-
selectionRect.top + selectionRect.height - pickerHeight + scrollTop;
|
|
127
|
-
left.value =
|
|
128
|
-
selectionRect.left + selectionRect.width + offset + scrollLeft;
|
|
129
|
-
transOrigin.value = "left bottom";
|
|
130
|
-
break;
|
|
131
|
-
default:
|
|
132
|
-
// 默认处理
|
|
133
|
-
top.value = selectionRect.top - pickerHeight - offset + scrollTop;
|
|
134
|
-
left.value =
|
|
135
|
-
selectionRect.left +
|
|
136
|
-
(selectionRect.width - pickerWidth) / 2 +
|
|
137
|
-
scrollLeft;
|
|
134
|
+
|
|
135
|
+
if (calcLeft < 0) calcLeft = 0;
|
|
136
|
+
else if (calcLeft + pickerW > clientWidth) calcLeft = clientWidth - pickerW;
|
|
137
|
+
|
|
138
|
+
if (calcTop < 0) calcTop = 0;
|
|
139
|
+
else if (calcTop + pickerH > clientHeight) calcTop = clientHeight - pickerH;
|
|
140
|
+
|
|
141
|
+
// 加上滚动距离
|
|
142
|
+
top.value = calcTop + scrollTop;
|
|
143
|
+
left.value = calcLeft + scrollLeft;
|
|
144
|
+
|
|
145
|
+
transOrigin.value = `${originX} ${originY}`;
|
|
146
|
+
|
|
147
|
+
if (currentPlacement.value !== finalPlacement) {
|
|
148
|
+
currentPlacement.value = finalPlacement;
|
|
138
149
|
}
|
|
139
150
|
}
|