소스 검색

详情页面高度计算

liuQiang 1 년 전
부모
커밋
916f7c7077
1개의 변경된 파일10개의 추가작업 그리고 4개의 파일을 삭제
  1. 10 4
      pagesA/fire/fpd_detection/detection_details/detection_details.vue

+ 10 - 4
pagesA/fire/fpd_detection/detection_details/detection_details.vue

@@ -74,6 +74,7 @@
 			}
 		},
 		mounted() {
+
 			// uni.createSelectorQuery().in(this).select('.heigthButton').boundingClientRect(data => {
 			// 	console.log('data',data);
 			// 	this.wheight = data.height
@@ -120,10 +121,15 @@
 							}
 						});
 					});
-					uni.createSelectorQuery().in(this).select('.heigthButton').boundingClientRect(data => {
-						console.log('data',data);
-						this.wheight = data.height
-					}).exec()
+					//dom生成之后再获取节点计算高度
+					this.$nextTick(() => {
+
+						uni.createSelectorQuery().in(this).select('.heigthButton').boundingClientRect(
+							data => {
+								console.log('data', data);
+								this.wheight = data.height
+							}).exec()
+					})
 					console.log('edit页面的val的值', this.formData);
 				})