From da25434b85fc5b4321c429bf95e719d00ec395bb Mon Sep 17 00:00:00 2001
From: quanyawei <401863037@qq.com>
Date: Thu, 11 Jan 2024 16:21:16 +0800
Subject: [PATCH] 定位优化
---
uni_modules/uview-ui/components/u-scroll-list/nvue.js | 28 ++++++++++++++++++++++++++++
1 files changed, 28 insertions(+), 0 deletions(-)
diff --git a/uni_modules/uview-ui/components/u-scroll-list/nvue.js b/uni_modules/uview-ui/components/u-scroll-list/nvue.js
new file mode 100644
index 0000000..94bb056
--- /dev/null
+++ b/uni_modules/uview-ui/components/u-scroll-list/nvue.js
@@ -0,0 +1,28 @@
+// ������bindingx���������������������������������wxs���������������js���������������������������������������������������������������
+const BindingX = uni.requireNativePlugin('bindingx')
+
+export default {
+ methods: {
+ // ������������������������������������
+ nvueScrollHandler(e) {
+ const anchor = this.$refs['u-scroll-list__scroll-view'].ref
+ const element = this.$refs['u-scroll-list__indicator__line__bar'].ref
+ const scrollLeft = e.contentOffset.x
+ const contentSize = e.contentSize.width
+ const { scrollWidth } = this
+ const barAllMoveWidth = this.indicatorWidth - this.indicatorBarWidth
+ // ������������iOS������������������������������������iOS������������2
+ const actionNum = uni.$u.os() === 'ios' ? 2 : 1
+ const expression = `(x / ${actionNum}) / ${contentSize - scrollWidth} * ${barAllMoveWidth}`
+ BindingX.bind({
+ anchor,
+ eventType: 'scroll',
+ props: [{
+ element,
+ property: 'transform.translateX',
+ expression
+ }]
+ })
+ }
+ }
+}
--
Gitblit v1.8.0