sard-uniapp 1.24.3 → 1.24.4
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/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
## [1.24.4](https://github.com/sutras/sard-uniapp/compare/v1.24.3...v1.24.4) (2025-09-13)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **form-item:** 修复滚动报错问题 ([046fc16](https://github.com/sutras/sard-uniapp/commit/046fc16abc03e260172eb9a6f763b241d58ebd05))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
1
10
|
## [1.24.3](https://github.com/sutras/sard-uniapp/compare/v1.24.2...v1.24.3) (2025-09-13)
|
|
2
11
|
|
|
3
12
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { computed, nextTick, onBeforeUnmount, onMounted, provide, reactive, ref, toRef, watch, } from 'vue';
|
|
1
|
+
import { computed, getCurrentInstance, nextTick, onBeforeUnmount, onMounted, provide, reactive, ref, toRef, watch, } from 'vue';
|
|
2
2
|
import { formItemContextSymbol, useFormContext, } from '../form/common';
|
|
3
3
|
import { chainGet, chainSet, deepClone, getBoundingClientRect, getScrollIntoViewValue, getViewportScrollInfo, getWindowInfo, noop, toArray, uniqid, } from '../../utils';
|
|
4
4
|
export function useFormItem(props) {
|
|
@@ -137,10 +137,11 @@ export function useFormItem(props) {
|
|
|
137
137
|
clearValidate();
|
|
138
138
|
};
|
|
139
139
|
const fieldId = uniqid();
|
|
140
|
+
const instance = getCurrentInstance();
|
|
140
141
|
const scrollToField = async () => {
|
|
141
142
|
const [scrollInfo, fieldRect, windowInfo] = await Promise.all([
|
|
142
143
|
getViewportScrollInfo(),
|
|
143
|
-
getBoundingClientRect(`.${fieldId}
|
|
144
|
+
getBoundingClientRect(`.${fieldId}`, instance),
|
|
144
145
|
getWindowInfo(),
|
|
145
146
|
]);
|
|
146
147
|
const scrollTop = getScrollIntoViewValue(windowInfo.windowHeight, scrollInfo.scrollTop, fieldRect.height, fieldRect.top + scrollInfo.scrollTop, formContext.scrollIntoViewOptions);
|