提交 65c083b8 编写于 作者: H hdx

custom-tab-bar: 调整 getBoundingClientRectAsync

上级 a6f84482
......@@ -188,7 +188,7 @@
// component: this,
success: (context : CanvasContext) => {
const renderingContext = context.getContext('2d')!;
const canvas = renderingContext!.canvas;
const canvas = renderingContext.canvas;
const dpr = uni.getDeviceInfo().devicePixelRatio ?? 1;
canvas.width = canvas.offsetWidth * dpr
......
......@@ -75,7 +75,9 @@
},
onReady() {
// this.setSelectedIndex(0)
this.tabViewHeight = (this.$refs["tabview"] as UniElement).getBoundingClientRect().height
(this.$refs["tabview"] as UniElement).getBoundingClientRectAsync().then((res: DOMRect) => {
this.tabViewHeight = res.height
});
},
onUnload() {
uni.$off('tabchange', this.onTabPageEvent)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册