提交 fae10604 编写于 作者: H hdx

swiper-list: 重命名 Element 为 UniElement

上级 d9c7a1aa
......@@ -46,8 +46,8 @@
return {
swiperList: [] as SwiperViewItem[],
swiperIndex: -1,
$tabScrollView: null as null | Element,
$indicatorNode: null as null | Element,
$tabScrollView: null as null | UniElement,
$indicatorNode: null as null | UniElement,
$animationFinishIndex: 0,
$swiperWidth: 0,
$swiperTabsRect: [] as SwiperTabsItem[]
......@@ -63,9 +63,9 @@
}
},
onReady() {
this.$tabScrollView = this.$refs['tabScroll'] as Element
this.$indicatorNode = this.$refs['indicator'] as Element
this.$swiperWidth = (this.$refs["swiper"] as Element).getBoundingClientRect().width
this.$tabScrollView = this.$refs['tabScroll'] as UniElement
this.$indicatorNode = this.$refs['indicator'] as UniElement
this.$swiperWidth = (this.$refs["swiper"] as UniElement).getBoundingClientRect().width
this.cacheTabItemsSize()
this.setSwiperIndex(0, true)
},
......@@ -119,7 +119,7 @@
*/
cacheTabItemsSize() {
this.$swiperTabsRect.length = 0;
const tabs = this.$refs["swipertab"] as Element[]
const tabs = this.$refs["swipertab"] as UniElement[]
tabs.forEach((node) => {
this.$swiperTabsRect.push({
x: node.offsetLeft,
......
......@@ -40,7 +40,7 @@
return {
swiperList: [] as SwiperViewItem[],
swiperIndex: -1,
$tabScrollView: null as null | Element,
$tabScrollView: null as null | UniElement,
$animationFinishIndex: 0,
$swiperWidth: 0
}
......@@ -53,8 +53,8 @@
}
},
onReady() {
this.$tabScrollView = this.$refs['tabScroll'] as Element
this.$swiperWidth = (this.$refs["swiper"] as Element).getBoundingClientRect().width
this.$tabScrollView = this.$refs['tabScroll'] as UniElement
this.$swiperWidth = (this.$refs["swiper"] as UniElement).getBoundingClientRect().width
this.setSwiperIndex(0, true)
},
methods: {
......@@ -108,7 +108,7 @@
const min_ratio = 1
const max_ratio = 1.3
const tabs = this.$refs['swipertab'] as Element[]
const tabs = this.$refs['swipertab'] as UniElement[]
const current_node = tabs[current_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.
先完成此消息的编辑!
想要评论请 注册