diff --git a/packages/uni-cli-shared/components/unicloud-db.vue b/packages/uni-cli-shared/components/unicloud-db.vue index 288b3d7ab9038726d1296a46fa40fb2f4a7b508b..eae4757ee4f10fa2572decaa8b619aef96ae25a9 100644 --- a/packages/uni-cli-shared/components/unicloud-db.vue +++ b/packages/uni-cli-shared/components/unicloud-db.vue @@ -34,6 +34,7 @@ const loadMode = { const attrs = [ 'pageCurrent', 'pageSize', + 'spaceInfo', 'collection', 'action', 'field', @@ -54,6 +55,12 @@ export default { return {} } }, + spaceInfo: { + type: Object, + default() { + return {} + } + }, collection: { type: [String, Array], default: '' @@ -323,7 +330,7 @@ export default { }) } /* eslint-disable no-undef */ - let db = uniCloud.database() + let db = uniCloud.database(this.spaceInfo) if (action) { db = db.action(action) } @@ -397,7 +404,7 @@ export default { }) } /* eslint-disable no-undef */ - let db = uniCloud.database() + let db = uniCloud.database(this.spaceInfo) if (action) { db = db.action(action) } @@ -426,7 +433,7 @@ export default { }, getTemp (isTemp = true) { /* eslint-disable no-undef */ - let db = uniCloud.database() + let db = uniCloud.database(this.spaceInfo) if (this.action) { db = db.action(this.action) @@ -575,7 +582,7 @@ export default { } /* eslint-disable no-undef */ - const db = uniCloud.database() + const db = uniCloud.database(this.spaceInfo) const dbCmd = db.command let exec = db