wechat-miniprogram / mobx-miniprogram-bindings

小程序的 MobX 绑定辅助库
MIT License
206 stars 20 forks source link

typescipt 在page绑定一个方法怎么帮这个方法写回WechatMiniprogram.Page.Constructor #15

Closed callmesoul closed 4 months ago

callmesoul commented 3 years ago
createStoreBindings(this, {
            store,
            fields: ['classId'],
            actions: ['changeCurrentClassId']
        })
// 选择班级
    chooseClass (e: any) {
        const id = e.currentTarget.dataset.id
        this.changeCurrentClassId(id)
    },
any
类型“Instance<{}, { data: {}; onLoad: (options: Record<string, string | undefined>) => void; onReady: () => void; onShow: () => void; onHide: () => void; onUnload: () => void; onPullDownRefresh: () => void; onReachBottom: () => void; onShareAppMessage: () => void; chooseClass(e: any): void; }>”上不存在属性“changeCurrentClassId”
ShmilyLin commented 2 years ago

是的,一年多了,还没修复这个问题

ace0109 commented 1 year ago

3年了,还没处理

LastLeaf commented 4 months ago

这个是做不到的。只能通过类似 #47 的那种处理方式。