nodes-info-child.uvue 593 B

1234567891011121314151617181920212223242526272829
  1. <template>
  2. <view class="selector-query-child-view">
  3. <text class="selector-query-child-text">selector-query-child</text>
  4. </view>
  5. </template>
  6. <script>
  7. export default {
  8. data() {
  9. return {
  10. top: 0
  11. }
  12. },
  13. mounted() {
  14. uni.createSelectorQuery().in(this).select('.selector-query-child-view').boundingClientRect().exec((ret) => {
  15. if (ret.length == 1) {
  16. const nodeInfo = ret[0] as NodeInfo;
  17. this.top = nodeInfo.top!
  18. }
  19. })
  20. }
  21. }
  22. </script>
  23. <style>
  24. .selector-query-child-view {
  25. margin-top: 15px;
  26. }
  27. </style>