Page外的function如何调用setData()
发布于 6 年前 作者 fujing 4064 次浏览 来自 问答

const app = getApp()

Page({

     bottomModal()

    })

function bottomModal() {

    this.setData({ modalName: ‘bottomModal’

})

请教各位大神,我在Page外自定义function,怎么才能通过setData设置数据呢?

2 回复

this 传进来试试

获取页面实例

回到顶部