提交 25d3c197 编写于 作者: d-u-a's avatar d-u-a 提交者: 雪洛

feat: space info for unicloud-db component

上级 00ffaf5d
...@@ -34,6 +34,7 @@ const loadMode = { ...@@ -34,6 +34,7 @@ const loadMode = {
const attrs = [ const attrs = [
'pageCurrent', 'pageCurrent',
'pageSize', 'pageSize',
'spaceInfo',
'collection', 'collection',
'action', 'action',
'field', 'field',
...@@ -54,6 +55,12 @@ export default { ...@@ -54,6 +55,12 @@ export default {
return {} return {}
} }
}, },
spaceInfo: {
type: Object,
default() {
return {}
}
},
collection: { collection: {
type: [String, Array], type: [String, Array],
default: '' default: ''
...@@ -323,7 +330,7 @@ export default { ...@@ -323,7 +330,7 @@ export default {
}) })
} }
/* eslint-disable no-undef */ /* eslint-disable no-undef */
let db = uniCloud.database() let db = uniCloud.database(this.spaceInfo)
if (action) { if (action) {
db = db.action(action) db = db.action(action)
} }
...@@ -397,7 +404,7 @@ export default { ...@@ -397,7 +404,7 @@ export default {
}) })
} }
/* eslint-disable no-undef */ /* eslint-disable no-undef */
let db = uniCloud.database() let db = uniCloud.database(this.spaceInfo)
if (action) { if (action) {
db = db.action(action) db = db.action(action)
} }
...@@ -426,7 +433,7 @@ export default { ...@@ -426,7 +433,7 @@ export default {
}, },
getTemp (isTemp = true) { getTemp (isTemp = true) {
/* eslint-disable no-undef */ /* eslint-disable no-undef */
let db = uniCloud.database() let db = uniCloud.database(this.spaceInfo)
if (this.action) { if (this.action) {
db = db.action(this.action) db = db.action(this.action)
...@@ -575,7 +582,7 @@ export default { ...@@ -575,7 +582,7 @@ export default {
} }
/* eslint-disable no-undef */ /* eslint-disable no-undef */
const db = uniCloud.database() const db = uniCloud.database(this.spaceInfo)
const dbCmd = db.command const dbCmd = db.command
let exec = db let exec = db
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册