onshow调用selectComponent报错

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

错误样例: this.selectComponent is not a function. (In 'this.selectComponent("#SharePosterImage")', 'this.selectComponent' is undefined);at "pages/detail/detail" page lifeCycleMethod onShow function

代码样例:

if (this.selectComponent('#SharePosterImage')) {
        this.selectComponent('#SharePosterImage').cancelModal()
}
3 回复
yang50
yang501 楼6 年前

我也是同样的问题,楼主解决了吗

shenjuan
shenjuan2 楼6 年前
guiying04
guiying043 楼5 年前

能把能把你onShow截大一点,看起来可能是你this的指向不对