nodes-info-child.uvue 614 字节
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
<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() {
      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!
        }
      })
    }
  }
</script>

<style>
  .selector-query-child-view {
    margin-top: 15px;
  }
</style>