<van-dialog v-model="showModel" :show-confirm-button="false" :close-on-click-overlay="true">
<div class="viewRadio" ref="viewRadio">
<van-radio-group v-model="radio">
<van-radio
:class="`radio${item}`"
:ref="`radio${item}`"
:name="item"
v-for="item in nums"
:key="item"
@click="handelPageChange(item)"
>{{ item }}</van-radio
>
</van-radio-group>
</div>
</van-dialog>
js
smoothScroll(element) {
document.querySelector(`.${element}`).scrollIntoView({
behavior: 'smooth'
})
},
handelModelShow(page) {
this.radio = page
let refIndex = 'radio' + page
this.showModel = true
this.$nextTick(() => {
this.smoothScroll(refIndex)
})
},
vant 弹出框自动滚动选择数据
最新推荐文章于 2023-11-28 14:47:27 发布