onshow调用selectComponent报错
发布于 5 年前 作者 nalu 9170 次浏览 来自 问答

错误样例: 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 回复

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

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

回到顶部