Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
fae10604
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
6005
Star
91
Fork
164
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
18
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello uni-app x
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
18
Issue
18
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
fae10604
编写于
1月 09, 2024
作者:
H
hdx
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
swiper-list: 重命名 Element 为 UniElement
上级
d9c7a1aa
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
10 addition
and
10 deletion
+10
-10
pages/template/swiper-list/swiper-list.uvue
pages/template/swiper-list/swiper-list.uvue
+6
-6
pages/template/swiper-list2/swiper-list2.uvue
pages/template/swiper-list2/swiper-list2.uvue
+4
-4
未找到文件。
pages/template/swiper-list/swiper-list.uvue
浏览文件 @
fae10604
...
@@ -46,8 +46,8 @@
...
@@ -46,8 +46,8 @@
return {
return {
swiperList: [] as SwiperViewItem[],
swiperList: [] as SwiperViewItem[],
swiperIndex: -1,
swiperIndex: -1,
$tabScrollView: null as null | Element,
$tabScrollView: null as null |
Uni
Element,
$indicatorNode: null as null | Element,
$indicatorNode: null as null |
Uni
Element,
$animationFinishIndex: 0,
$animationFinishIndex: 0,
$swiperWidth: 0,
$swiperWidth: 0,
$swiperTabsRect: [] as SwiperTabsItem[]
$swiperTabsRect: [] as SwiperTabsItem[]
...
@@ -63,9 +63,9 @@
...
@@ -63,9 +63,9 @@
}
}
},
},
onReady() {
onReady() {
this.$tabScrollView = this.$refs['tabScroll'] as Element
this.$tabScrollView = this.$refs['tabScroll'] as
Uni
Element
this.$indicatorNode = this.$refs['indicator'] as Element
this.$indicatorNode = this.$refs['indicator'] as
Uni
Element
this.$swiperWidth = (this.$refs["swiper"] as Element).getBoundingClientRect().width
this.$swiperWidth = (this.$refs["swiper"] as
Uni
Element).getBoundingClientRect().width
this.cacheTabItemsSize()
this.cacheTabItemsSize()
this.setSwiperIndex(0, true)
this.setSwiperIndex(0, true)
},
},
...
@@ -119,7 +119,7 @@
...
@@ -119,7 +119,7 @@
*/
*/
cacheTabItemsSize() {
cacheTabItemsSize() {
this.$swiperTabsRect.length = 0;
this.$swiperTabsRect.length = 0;
const tabs = this.$refs["swipertab"] as Element[]
const tabs = this.$refs["swipertab"] as
Uni
Element[]
tabs.forEach((node) => {
tabs.forEach((node) => {
this.$swiperTabsRect.push({
this.$swiperTabsRect.push({
x: node.offsetLeft,
x: node.offsetLeft,
...
...
pages/template/swiper-list2/swiper-list2.uvue
浏览文件 @
fae10604
...
@@ -40,7 +40,7 @@
...
@@ -40,7 +40,7 @@
return {
return {
swiperList: [] as SwiperViewItem[],
swiperList: [] as SwiperViewItem[],
swiperIndex: -1,
swiperIndex: -1,
$tabScrollView: null as null | Element,
$tabScrollView: null as null |
Uni
Element,
$animationFinishIndex: 0,
$animationFinishIndex: 0,
$swiperWidth: 0
$swiperWidth: 0
}
}
...
@@ -53,8 +53,8 @@
...
@@ -53,8 +53,8 @@
}
}
},
},
onReady() {
onReady() {
this.$tabScrollView = this.$refs['tabScroll'] as Element
this.$tabScrollView = this.$refs['tabScroll'] as
Uni
Element
this.$swiperWidth = (this.$refs["swiper"] as Element).getBoundingClientRect().width
this.$swiperWidth = (this.$refs["swiper"] as
Uni
Element).getBoundingClientRect().width
this.setSwiperIndex(0, true)
this.setSwiperIndex(0, true)
},
},
methods: {
methods: {
...
@@ -108,7 +108,7 @@
...
@@ -108,7 +108,7 @@
const min_ratio = 1
const min_ratio = 1
const max_ratio = 1.3
const max_ratio = 1.3
const tabs = this.$refs['swipertab'] as Element[]
const tabs = this.$refs['swipertab'] as
Uni
Element[]
const current_node = tabs[current_index]!
const current_node = tabs[current_index]!
const move_to_node = tabs[move_to_index]!
const move_to_node = tabs[move_to_index]!
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录