小朋友
小朋友
  • 发布:2022-03-17 17:21
  • 更新:2022-03-25 10:34
  • 阅读:840

unicloud-db 获取不到数据,xid 是有值的

分类:uniCloud

unicloud-db 获取不到数据,xid 是有值的

2022-03-17 17:21 负责人:无 分享
已邀请:
小朋友

小朋友 (作者) - 规范化广泛的

这样没有问题

小朋友

小朋友 (作者) - 规范化广泛的

是不是官方的bug啊

DCloud_uni-ad_HDX

DCloud_uni-ad_HDX

组件默认会加载数据,在加载的过程中再次修改where,因上次结果没有返回,此次的where会被忽略掉,参考文档代码,设置组件加载数据模式为手动 loadtime="manual"

<template>  
    <view>  
        <unicloud-db ref="udb" collection="uni-id-users" :where="sWhere" loadtime="manual"></unicloud-db>  
    </view>  
</template>  
<script>  
    export default {  
        data() {  
            return {  
                tempstr: '123',  
                sWhere: ''  
            }  
        }  
        onLoad() {  
            this.sWhere = "id=='" + this.tempstr + "'"  
            // 组件上配置了 loadtime = "manual", 这里需要手动加载数据  
            this.$nextTick(() => {  
              this.$refs.udb.loadData()  
            })  

            // 多条件示例  

            // id = this.tempstr 且 create_time > 1613960340000  
            // this.sWhere = "id=='" + this.tempstr + "' && create_time > 1613960340000"  

            // id = this.tempstr 或 name != null  
            // this.sWhere = "id=='" + this.tempstr + "' || name != null"  
        }  
    }  
</script>

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