wx.pageScrollTo 没效果

发布于 7 年前作者 wuchao8182 次浏览最后编辑 7 年前来自 issues

不管放什么参数都没效果 只有个A打印出来 complete什么的都打印不出东西

toLast:function(){

    var that = this

    console.log(‘A’)

    wx.pageScrollTo({

        selector: ‘last’,

    })

}

4 回复
taoyu
taoyu1 楼6 年前

<view class=“last” id=“last”></view>

‘.last’ 或 ‘#last’

还有就是如果该节点元素已经在屏幕可视区域,就不会在有滚动效果

yyan
yyan2 楼6 年前

 wx.pageScrollTo({

        selector: 'last',

    })

last 前加 ‘.’或者‘#’

 wx.pageScrollTo({

        selector: '.last',

    })

或者

 wx.pageScrollTo({

        selector: '#last',

    })

jie07
jie073 楼6 年前

现在就是这样  点了后 打印是成功执行 但是没有效果

chao78
chao784 楼5 年前

selector 语法

selector类似于 CSS 的选择器,但仅支持下列语法。

  • ID选择器:#the-id

  • class选择器(可以连续指定多个):.a-class.another-class

  • 子元素选择器:.the-parent > .the-child

  • 后代选择器:.the-ancestor .the-descendant

  • 跨自定义组件的后代选择器:.the-ancestor >>> .the-descendant

  • 多选择器的并集:#a-node, .some-other-nodes