fix(harmony): 鸿蒙环境下延迟 mescroll 初始数据加载,确保 DOM 渲染就绪

- 根因:鸿蒙 ArkUI DOM 初始化管线比 Vue 响应式系统慢
- mescroll mounted 时立即触发 resetUpScroll,数据返回时 ArkUI 尚未完全就绪
- 导致 goodsList 赋值后视图不更新,需点击排序等交互后才刷新
- 修复:MP-HARMONY 环境下延迟 400ms 再调用 resetUpScroll
- 不影响其他平台
This commit is contained in:
2026-06-05 11:30:36 +08:00
parent 1ab8a52c38
commit cbbb1e0327

View File

@@ -72,8 +72,17 @@ export default {
this.isInit = true;
},
mounted() {
// #ifdef MP-HARMONY
// 鸿蒙 ArkUI DOM 初始化较慢,延迟加载确保渲染管线就绪
setTimeout(() => {
this.mescroll.resetUpScroll();
this.listenRefresh();
}, 400);
// #endif
// #ifndef MP-HARMONY
this.mescroll.resetUpScroll();
this.listenRefresh();
// #endif
},
methods: {
// mescroll组件初始化的回调,可获取到mescroll对象