s***@foxmail.com
s***@foxmail.com
  • 发布:2020-12-16 23:53
  • 更新:2020-12-18 16:22
  • 阅读:591

uni-clientDB中action的after不生效

分类:uniCloud

action (get_action_cover) 代码如下:

module.exports = {  
    before: async (state, event) => {  

    },  
    after: async (state, event, error, result) => {  
        if (error) {  
            throw error  
        }  
        result.msg="调用了 after"  
        return result  
    }  
}

组件调用:

<uni-clientdb v-slot:default="{ loading, data, error }" collection="workout" where="day == 1" action="get_action_cover">  
    {{ data.msg }}  
</uni-clientdb>

显示出来 undefined.

2020-12-16 23:53 负责人:DCloud_uniCloud_WYQ 分享
已邀请:
DCloud_uniCloud_WYQ

DCloud_uniCloud_WYQ

你用的clientDB组件的版本可能太老了,更新一下看看

  • s***@foxmail.com (作者)

    更新了组件和 HBuilderX, 确实好了...

    2020-12-20 10:49

该问题目前已经被锁定, 无法添加新回复