我是加了这个删除按钮及其绑定的点击事件才报的这个错,但我点击删除按钮不会报错,并且我数据库里有uni-id-users数据表,并且uni-id-users.schema.json文件里,设置了create/delete/update/read的权限为true,不知道为什么还报这个错
```javascript
html代码
<view>
<unicloud-db ref="udb" collection="uni-id-users" v-slot:default="{data,pagination,loading,error}" field="_id,username,avatar_file,mobile,key">
<uni-table :loading="loading" :emptyText="error.message || '没有更多数据'" border stripe >
<uni-tr>
<uni-th>用户名</uni-th>
<uni-th>操作</uni-th>
</uni-tr>
<uni-tr v-for="(item,index) in data" :key="index">
<view class="message">
<cloud-image :src="item.avatar_file.url" class="image">
</cloud-image>
<view class="user-message">
<view class="username">
用户名:{{item.username}}
</view>
<view class="phone">
手机号:{{item.mobile}}
</view>
</view>
</view>
<uni-td>
<view class="button">
<button @click="confirmDelete(item._id)" type="warn">删除</button>
<button @click="update(item._id,item.username,item.avatar_file,item.mobile)">修改</button>
</view>
</uni-td>
</uni-tr>
</uni-table>
<view class="button-add">
<button @click="add()">+</button>
</view>
</unicloud-db>
</view>
js代码
const db = uniCloud.database();
var adminBd;
export default {
data() {
return {
adminBd:false
}
},
methods: {
confirmDelete(id)
{
this.$refs.udb.remove(id)
},
update(id,username,avatar_file,mobile)
{
console.log("id="+id)
console.log("username="+username)
console.log("avatar_file="+avatar_file)
console.log("mobile="+mobile)
this.$refs.udb.update(id,username, {
toastTitle: '修改成功', // toast提示语
success: (res) => { // 更新成功后的回调
const { code, message } = res
},
fail: (err) => { // 更新失败后的回调
const { message } = err
},
complete: () => { // 完成后的回调
}
})
},
async add() {
uni.showLoading({
title: '处理中...'
})
return await uniCloud.callFunction({
name: 'add',
data: {
name: 'DCloud',
subType: 'uniCloud',
createTime: Date.now()
}
}).then((res) => {
uni.hideLoading()
uni.showModal({
content: `成功添加一条数据,文档id为:${res.result.id}`,
showCancel: false
})
console.log(res)
return res.result.id
}).catch((err) => {
uni.hideLoading()
uni.showModal({
content: `添加数据失败,错误信息为:${err.message}`,
showCancel: false
})
console.error(err)
})
}
}
}
```