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 30
| <tui-sticky :scrollTop="scrollTop" stickyHeight="104rpx" container> <template v-slot:header> <view class="sticky-item"> <view class="setting">设置</view> </view> </template> <template v-slot:content> <tui-list-view class="content"> <tui-list-cell :arrow="false"> <switch class='switch' checked color="#FFCC33" /> </tui-list-cell> </tui-list-view> </template> </tui-sticky>
<script setup> import { ref } from 'vue' import { onPageScroll } from '@dcloudio/uni-app'
const scrollTop = ref(0) onPageScroll((e) => { scrollTop.value = e.scrollTop }) </script>
|