当前位置:   article > 正文

scroll-view据顶部距离计算高度_scroll-view 当前元素距离顶端的scrolltop

scroll-view 当前元素距离顶端的scrolltop
  1. <template>
  2. <view>
  3. <view class="tablist">
  4. <text v-for="item in tablist" :class="item.id==id?'text':''" @click="tabclick(item)">{
  5. {item.title}}</text>
  6. </view>
  7. <h3>{
  8. {title}}</h3>
  9. <scroll-view scroll-y="true" :style="`height: calc(100vh - ${top}px);`">
  10. <view class="list">
  11. <view class="listitem" v-for="item in list">
  12. {
  13. {item.title}}
  14. </view>
  15. </view>
  16. </scroll-view>
  17. </view>
  18. </template>
  19. <script>
  20. import {
  21. sbsdcat,
  22. sbsdlist
  23. } from '@/config/api/index.js'
  24. export default {
  25. data() {
  26. return {
  27. tablist: [],
  28. id: 35,
  29. title: '公共英语',
  30. list: [],
  31. top:''
  32. }
  33. },
  34. created() {
  35. this.getdata()
  36. },
  37. mounted() {
  38. cons
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Monodyee/article/detail/384089
推荐阅读
相关标签
  

闽ICP备14008679号