奔跑吧阿虎
奔跑吧阿虎
  • 发布:2025-07-08 01:44
  • 更新:2025-07-08 01:44
  • 阅读:27

【报Bug】unicloud-db 组件自动查询的问题

分类:uniCloud

产品分类: uniCloud/App

示例代码:
 <uni-easyinput  
              v-model="searchForm.nickname"  
              placeholder="请输入用户昵称"  
              @input="handleSearch"  
              :clearable="true"  
      />  
<unicloud-db ref="udb" v-slot:default="{data, pagination, loading, hasMore, error}" collection="uni-id-users"  
                 field="_id,nickname,avatar_file,mobile,role,username,email,status,last_login_date"  
                 orderby="register_date desc"  
                 :where="where"  
                 :getcount="true"  
                 :manual="true"  loadtime="manual"  
    >  

computed: {  
    where() {  
      const where = {}  
      if (this.searchForm.nickname) {  
        where.nickname = new RegExp(this.searchForm.nickname, 'i')  
      }  
      if (this.searchForm.role) {  
        where.role = this.searchForm.role  
      }  
      return where  
    }  
  },  

操作步骤:

直接参考上边的代码示例

预期结果:

直接参考上边的代码示例

实际结果:

直接参考上边的代码示例

bug描述:

当 db 组件设置了 :manual="true" 时,如果同时设置了 where 为一个计算属性,那么当计算属性变化时,db组件还是会自动查询,manual属性不生效,如果使用最新的属性 loadtime="manual" ,则恢复正常 ,由于manual属性在部分官方示例中依然在使用(例如uni-starter),所以还是有必要修复一下的。

2025-07-08 01:44 负责人:无 分享
已邀请:

要回复问题请先登录注册