<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
}
},

奔跑吧阿虎
- 发布:2025-07-08 01:44
- 更新:2025-07-09 10:48
- 阅读:543
产品分类: uniCloud/App
示例代码:
操作步骤:
直接参考上边的代码示例
直接参考上边的代码示例
预期结果:
直接参考上边的代码示例
直接参考上边的代码示例
实际结果:
直接参考上边的代码示例
直接参考上边的代码示例
bug描述:
当 db 组件设置了 :manual="true" 时,如果同时设置了 where 为一个计算属性,那么当计算属性变化时,db组件还是会自动查询,manual属性不生效,如果使用最新的属性 loadtime="manual" ,则恢复正常 ,由于manual属性在部分官方示例中依然在使用(例如uni-starter),所以还是有必要修复一下的。
奔跑吧阿虎 (作者)
按照文档上来说,manual 设置为true时,组件就不会自动加载了,但是当组件的where是一个计算属性时,他就会自动加载。(并没有调用 this.$refs.udb.loadData() 方法,你可以测试下 )
2025-07-09 22:06
DCloud_uni-ad_HDX
回复 奔跑吧阿虎: 是这个逻辑,仅在 onReady 生命周期生效一次,引用文档:
manual="true"
已过时,使用 loadtime 替代 是否手动加载数据,默认为 false,页面onready时自动联网加载数据2025-07-10 10:41