提交 fae10604 编写于 作者: H hdx

swiper-list: 重命名 Element 为 UniElement

上级 d9c7a1aa
...@@ -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 | UniElement,
$indicatorNode: null as null | Element, $indicatorNode: null as null | UniElement,
$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 UniElement
this.$indicatorNode = this.$refs['indicator'] as Element this.$indicatorNode = this.$refs['indicator'] as UniElement
this.$swiperWidth = (this.$refs["swiper"] as Element).getBoundingClientRect().width this.$swiperWidth = (this.$refs["swiper"] as UniElement).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 UniElement[]
tabs.forEach((node) => { tabs.forEach((node) => {
this.$swiperTabsRect.push({ this.$swiperTabsRect.push({
x: node.offsetLeft, x: node.offsetLeft,
......
...@@ -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 | UniElement,
$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 UniElement
this.$swiperWidth = (this.$refs["swiper"] as Element).getBoundingClientRect().width this.$swiperWidth = (this.$refs["swiper"] as UniElement).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 UniElement[]
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.
先完成此消息的编辑!
想要评论请 注册