目的其实是需要将含有超长内容的元素滚动到底部,web端正常使用,转换到小程序里面就会提示scrollTo is not a function
代码如下:
<template>
<div class="scroll-wrapper">
<div class="scroll-content" ref="scroll-content">
</div>
</template>
<script>
export default {
name: 'scroll',
created(){
this.$refs['scroll-content'].scrollTo(0,this.$refs['scroll-content'].scrollHeight)
}
}
</script>
请问各位大佬,这是否有办法解,或者是否有其他方案实现该效果?
https://developers.weixin.qq.com/miniprogram/dev/api/ui/scroll/ScrollViewContext.scrollTo.html
wx.createSelectorQuery().select('.scroll-content').node().scrollTo({
top: 99999
})