界面
展开后自动滚动,如图:
技术
vue3 + ts + tailwindcss
代码
<div v-if="form.extraProperties?.showConfirm" ref="confirmRef">
内容区域
</div>
const confirmRef = ref()
function changeConfirm(e) {
if (e) {
nextTick(() => {
confirmRef.value.scrollIntoView({ behavior: 'smooth', block: 'start' })
})
}
}