diff --git a/components/uni-collapse-item/uni-collapse-item.vue b/components/uni-collapse-item/uni-collapse-item.vue index 45ed4713f7c77804a7b6a88aa620af725aae8065..44626c7fbb094fe459523cb77ae67a74bd80c652 100644 --- a/components/uni-collapse-item/uni-collapse-item.vue +++ b/components/uni-collapse-item/uni-collapse-item.vue @@ -35,8 +35,8 @@ return { height: 0, is_open: this.open as boolean, - boxNode: null as INode | null, - contentNode: null as INode | null, + boxNode: null as Element | null, + contentNode: null as Element | null, }; }, watch: { @@ -51,8 +51,8 @@ $dispatch(this, 'UniCollapse', 'init', this) }, mounted() { - this.boxNode = this.$refs['boxRef'] as INode; - this.contentNode = this.$refs['contentRef'] as INode; + this.boxNode = this.$refs['boxRef'] as Element; + this.contentNode = this.$refs['contentRef'] as Element; // this.openCollapse(this.open) }, methods: { diff --git a/pages/CSS/layout/z-index.uvue b/pages/CSS/layout/z-index.uvue index 9eb4ec2d74ec92ad5b867132b9481df579c8d0f3..aa3b84e04678c97ca7b1cfd8d8bc29645a7b229b 100644 --- a/pages/CSS/layout/z-index.uvue +++ b/pages/CSS/layout/z-index.uvue @@ -24,7 +24,7 @@ methods: { changeZIndex(zIndex : number) { this.zIndex = 20; - (this.$refs['view'] as INode).style.setProperty('z-index', zIndex); + (this.$refs['view'] as Element).style.setProperty('z-index', zIndex); } } } diff --git a/pages/component/general-attribute/general-attribute.uvue b/pages/component/general-attribute/general-attribute.uvue index 0779656cd736430055a28a30b8a56516a72b9ba2..3b3e7d751991336e119c56442f014b54a69d122c 100644 --- a/pages/component/general-attribute/general-attribute.uvue +++ b/pages/component/general-attribute/general-attribute.uvue @@ -69,7 +69,7 @@ export default { }, methods: { validateGeneralAttributes() { - const generalTarget = this.$refs.get('general-target') as INode + const generalTarget = this.$refs.get('general-target') as Element const generalId = generalTarget.getAttribute('id') if (generalId != this.generalId) { this.validateGeneralAttrText = '基础属性 id 验证失败' @@ -98,7 +98,7 @@ export default { this.validateGeneralAttrText = '基础属性验证成功' }, changeHeight(){ - const generalTarget = this.$refs['general-target'] as INode + const generalTarget = this.$refs['general-target'] as Element generalTarget.style.setProperty('height', '200px') } }, diff --git a/pages/component/input/input.uvue b/pages/component/input/input.uvue index d824cbf79b114edc83eea8b2302d402dffb6e30c..0027021b64bd0111e07fcff9c196af9311dab587 100644 --- a/pages/component/input/input.uvue +++ b/pages/component/input/input.uvue @@ -233,11 +233,11 @@ }, methods: { setCursor: function (cursor : number) { - (this.$refs['input'] as INode).focus(); + (this.$refs['input'] as Element).focus(); this.cursor = cursor; }, setSelection: function (selectionStart : number, selectionEnd : number) { - (this.$refs['input2'] as INode).focus(); + (this.$refs['input2'] as Element).focus(); this.selectionStart = selectionStart; this.selectionEnd = selectionEnd; }, diff --git a/pages/component/view/view-draw.uvue b/pages/component/view/view-draw.uvue index 6664010bd404fbe1c0e846ac530b5ea2789bbadf..efa349e0cbae3e67ec13198530e045ad9cb528cd 100644 --- a/pages/component/view/view-draw.uvue +++ b/pages/component/view/view-draw.uvue @@ -55,7 +55,7 @@ }, methods: { drawText() { - let node = (this.$refs['draw-text-view'] as INode) + let node = (this.$refs['draw-text-view'] as Element) let ctx = node.getDrawableContext() let width = node.getBoundingClientRect().width ctx!!.reset() @@ -72,7 +72,7 @@ ctx!!.update() }, drawLines() { - let ctx = (this.$refs['draw-line-view'] as INode).getDrawableContext() + let ctx = (this.$refs['draw-line-view'] as Element).getDrawableContext() ctx!!.reset() ctx!!.lineWidth = 10; @@ -127,7 +127,7 @@ y += 15; }, drawCircles() { - let ctx = (this.$refs['draw-circle-view'] as INode).getDrawableContext() + let ctx = (this.$refs['draw-circle-view'] as Element).getDrawableContext() ctx!!.reset() // Draw shapes for (var i = 0; i < 4; i++) { @@ -153,7 +153,7 @@ }, drawStar() { - let ctx = (this.$refs['draw-dash-line'] as INode).getDrawableContext() + let ctx = (this.$refs['draw-dash-line'] as Element).getDrawableContext() ctx!!.reset() ctx!!.beginPath(); var horn = 5; // 画5个角 @@ -224,7 +224,7 @@ return result }, drawhouse() { - let ctx = (this.$refs['draw-house'] as INode).getDrawableContext() + let ctx = (this.$refs['draw-house'] as Element).getDrawableContext() ctx!!.reset() ctx!!.lineWidth = 10; @@ -244,7 +244,7 @@ ctx!!.update() }, drawPoint() { - let ctx = (this.$refs['draw-style'] as INode).getDrawableContext() + let ctx = (this.$refs['draw-style'] as Element).getDrawableContext() ctx!!.reset() for (let i = 0; i < 6; i++) { for (let j = 0; j < 6; j++) { @@ -263,7 +263,7 @@ ctx!!.update() }, drawRect() { - let ctx = (this.$refs['draw-odd'] as INode).getDrawableContext() + let ctx = (this.$refs['draw-odd'] as Element).getDrawableContext() ctx!!.reset() // Create path ctx!!.moveTo(30, 90); diff --git a/pages/tabBar/API.uvue b/pages/tabBar/API.uvue index 1c7956a6430e325ab280b27f7488371149ab626f..48826c56e9b1214cff6fc40a36b920255386c952 100644 --- a/pages/tabBar/API.uvue +++ b/pages/tabBar/API.uvue @@ -490,10 +490,10 @@ }) }, showPop: function () { - (this.$refs["pop"] as INode).style.setProperty("display", "flex") + (this.$refs["pop"] as Element).style.setProperty("display", "flex") }, hidePop: function () { - (this.$refs["pop"] as INode).style.setProperty("display", "none") + (this.$refs["pop"] as Element).style.setProperty("display", "none") }, stopClickPop: function (e : MouseEvent) { e.stopPropagation() //点击到pop的非灰色区域,拦截点击事件 diff --git a/pages/template/calendar/calendar.uvue b/pages/template/calendar/calendar.uvue index dd56c76e08ccf42b59bd6ab12d1ec26c15d2c657..05359064050ac98dd421bdb679a1678871e567e3 100644 --- a/pages/template/calendar/calendar.uvue +++ b/pages/template/calendar/calendar.uvue @@ -65,7 +65,7 @@ // 触发整个日历的点击事件,需要计算点击位置 select(event : TouchEvent) { - const refs = this.$refs['draw-weeks'] as INode + const refs = this.$refs['draw-weeks'] as Element const rect = refs.getBoundingClientRect(); const dom_x = rect.left; // 元素左上角相对于视口的 X 坐标 const dom_y = rect.top; // 元素左上角相对于视口的 Y 坐标 @@ -139,7 +139,7 @@ // 绘制日历顶部信息 drawHeader() { - const refs = this.$refs['draw-header'] as INode + const refs = this.$refs['draw-header'] as Element let ctx = refs.getDrawableContext() if (ctx == null) return const date_header_map = ['一', '二', '三', '四', '五', '六', '日'] @@ -167,7 +167,7 @@ // 绘制日历主体 drawWeek(weeks : Array>, time : string) { const start_time = Date.now() - const refs = this.$refs['draw-weeks'] as INode + const refs = this.$refs['draw-weeks'] as Element let ctx = refs.getDrawableContext() if (ctx == null) return const dom = refs.getBoundingClientRect() diff --git a/pages/template/half-screen/half-screen.uvue b/pages/template/half-screen/half-screen.uvue index 7ea6e96c5ec23221fd68d6c769dcdba8a9576bea..840b8e66dd7788598f6c2a54ed1a8b80c1e2f2ea 100644 --- a/pages/template/half-screen/half-screen.uvue +++ b/pages/template/half-screen/half-screen.uvue @@ -26,8 +26,8 @@ lastY: 0, //上次 lastY2: 0, // bAnimation: false, //是否动画 - halfNode: null as INode | null, - scrollNode: null as INode | null + halfNode: null as Element | null, + scrollNode: null as Element | null } }, methods: { @@ -131,9 +131,9 @@ } }, onReady() { - this.halfNode = this.$refs['halfScreen'] as INode; + this.halfNode = this.$refs['halfScreen'] as Element; this.halfHeight = this.halfNode!.getBoundingClientRect().height; - this.scrollNode = this.$refs['halfScroll'] as INode; + this.scrollNode = this.$refs['halfScroll'] as Element; this.totalHeight = uni.getWindowInfo().windowHeight; this.halfNode?.style?.setProperty('top', this.totalHeight.toString()); diff --git a/pages/template/long-list/long-list.uvue b/pages/template/long-list/long-list.uvue index 9efae74407e31aaa0a121587a14dec6b5ac7d28c..b92e0161e1665479d5ca61406a345e9de3b58bed 100644 --- a/pages/template/long-list/long-list.uvue +++ b/pages/template/long-list/long-list.uvue @@ -76,21 +76,21 @@ } as SwiperViewItem ] as SwiperViewItem[], swiperIndex: -1, - $pageScrollView: null as null | INode, + $pageScrollView: null as null | Element, $headerHeight: 0, $animationFinishIndex: 0, - $tabScrollView: null as null | INode, - $indicatorNode: null as null | INode, + $tabScrollView: null as null | Element, + $indicatorNode: null as null | Element, $swiperWidth: 0, $swiperTabsRect: [] as SwiperTabsItem[] } }, onReady() { - this.$pageScrollView = this.$refs['pageScrollView'] as INode; - this.$headerHeight = (this.$refs['header'] as INode).offsetHeight - this.$swiperWidth = (this.$refs['swiper'] as INode).getBoundingClientRect().width - this.$tabScrollView = this.$refs['tabScroll'] as INode - this.$indicatorNode = this.$refs['indicator'] as INode + this.$pageScrollView = this.$refs['pageScrollView'] as Element; + this.$headerHeight = (this.$refs['header'] as Element).offsetHeight + this.$swiperWidth = (this.$refs['swiper'] as Element).getBoundingClientRect().width + this.$tabScrollView = this.$refs['tabScroll'] as Element + this.$indicatorNode = this.$refs['indicator'] as Element this.cacheTabItemsSize() this.setSwiperIndex(0, true) }, @@ -170,7 +170,7 @@ }, cacheTabItemsSize() { this.$swiperTabsRect.length = 0 - const tabs = this.$refs["swipertab"] as INode[] + const tabs = this.$refs["swipertab"] as Element[] tabs.forEach((node) => { this.$swiperTabsRect.push({ x: node.offsetLeft, @@ -260,4 +260,4 @@ .swiper-item { flex: 1; } - \ No newline at end of file + diff --git a/pages/template/scroll-sticky/scroll-sticky.uvue b/pages/template/scroll-sticky/scroll-sticky.uvue index bc0680d6b7a39264399c6813c680ff6c60e82948..381d52ef99f91c109ca2b64921fa942cabcb5c77 100644 --- a/pages/template/scroll-sticky/scroll-sticky.uvue +++ b/pages/template/scroll-sticky/scroll-sticky.uvue @@ -37,7 +37,7 @@ stickyTop: 0, stickyTran: 0, scrollTop: 0, - stickyNode: null as INode | null + stickyNode: null as Element | null } }, methods: { @@ -70,11 +70,11 @@ onLoad() { }, onReady() { - this.stickyNode = this.$refs['sticky'] as INode; + this.stickyNode = this.$refs['sticky'] as Element; // let rect = this.stickyNode?.getBoundingClientRect(); // this.stickyTop = rect?.top; //this.stickyTop = this.stickyNode?.getBoundingClientRect()?.top; - let rect = (this.$refs['sticky'] as INode).getBoundingClientRect(); + let rect = (this.$refs['sticky'] as Element).getBoundingClientRect(); this.stickyTop = rect.top; } } diff --git a/pages/template/swiper-list/swiper-list.uvue b/pages/template/swiper-list/swiper-list.uvue index 5aebd6ddce87375014dc4164d66cc067f7941672..7cd5623c55201f1822f778d65541ec38ce1ec6cd 100644 --- a/pages/template/swiper-list/swiper-list.uvue +++ b/pages/template/swiper-list/swiper-list.uvue @@ -45,8 +45,8 @@ return { swiperList: [] as SwiperViewItem[], swiperIndex: -1, - $tabScrollView: null as null | INode, - $indicatorNode: null as null | INode, + $tabScrollView: null as null | Element, + $indicatorNode: null as null | Element, $animationFinishIndex: 0, $swiperWidth: 0, $swiperTabsRect: [] as SwiperTabsItem[] @@ -61,9 +61,9 @@ } }, onReady() { - this.$tabScrollView = this.$refs['tabScroll'] as INode - this.$indicatorNode = this.$refs['indicator'] as INode - this.$swiperWidth = (this.$refs["swiper"] as INode).getBoundingClientRect().width + this.$tabScrollView = this.$refs['tabScroll'] as Element + this.$indicatorNode = this.$refs['indicator'] as Element + this.$swiperWidth = (this.$refs["swiper"] as Element).getBoundingClientRect().width this.cacheTabItemsSize() this.setSwiperIndex(0, true) }, @@ -104,7 +104,7 @@ }, cacheTabItemsSize() { this.$swiperTabsRect.length = 0; - const tabs = this.$refs["swipertab"] as INode[] + const tabs = this.$refs["swipertab"] as Element[] tabs.forEach((node) => { this.$swiperTabsRect.push({ x: node.offsetLeft, diff --git a/pages/template/swiper-list2/swiper-list2.uvue b/pages/template/swiper-list2/swiper-list2.uvue index c707db8cda32120c02813d4c9fb87d80623d6b51..4c4c7b2757163b9c72ba95a0ccc2c5e5b030d8ff 100644 --- a/pages/template/swiper-list2/swiper-list2.uvue +++ b/pages/template/swiper-list2/swiper-list2.uvue @@ -39,7 +39,7 @@ return { swiperList: [] as SwiperViewItem[], swiperIndex: -1, - $tabScrollView: null as null | INode, + $tabScrollView: null as null | Element, $animationFinishIndex: 0, $swiperWidth: 0 } @@ -52,8 +52,8 @@ } }, onReady() { - this.$tabScrollView = this.$refs['tabScroll'] as INode - this.$swiperWidth = (this.$refs["swiper"] as INode).getBoundingClientRect().width + this.$tabScrollView = this.$refs['tabScroll'] as Element + this.$swiperWidth = (this.$refs["swiper"] as Element).getBoundingClientRect().width this.setSwiperIndex(0, true) }, methods: { @@ -106,7 +106,7 @@ const min_ratio = 1 const max_ratio = 1.3 - const tabs = this.$refs['swipertab'] as INode[] + const tabs = this.$refs['swipertab'] as Element[] const current_node = tabs[current_index]! const move_to_node = tabs[move_to_index]!