nodes-info-child.uvue 621 字节
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
<template>
  <view class="selector-query-child-view">
    <text class="selector-query-child-text">selector-query-child</text>
  </view>
</template>

<script>
  export default {
    data() {
      return {
        top: 0
      }
    },
    mounted() {
DCloud-WZF's avatar
DCloud-WZF 已提交
15 16 17 18
      uni.createSelectorQuery().in(this).select('.selector-query-child-view').boundingClientRect().exec((ret) => {
        if (ret.length == 1) {
          const nodeInfo = ret[0] as NodeInfo;
          this.top = nodeInfo.top!
19 20 21 22 23 24
        }
      })
    }
  }
</script>

DCloud-WZF's avatar
DCloud-WZF 已提交
25 26 27
<style>
  .selector-query-child-view {
    margin-top: 15px;
28 29
  }
</style>