Skip to content

Commit

Permalink
feat(uni-app-x web): unicloud-db兼容nodejs8
Browse files Browse the repository at this point in the history
  • Loading branch information
Wangyaqi committed May 22, 2024
1 parent 04bf207 commit 27bcc92
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
5 changes: 4 additions & 1 deletion packages/uni-components/lib-x/unicloud-db/index.uts
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,10 @@ export const mixinDatacom = defineMixin({
}).catch((err : any | null) => {
this.mixinDatacomError = err as UniCloudError
options?.fail?.(err)
}).finally(() => {
}).then(() => {
this.mixinDatacomLoading = false
options?.complete?.()
}, () => {
this.mixinDatacomLoading = false
options?.complete?.()
})
Expand Down
21 changes: 15 additions & 6 deletions packages/uni-components/lib-x/unicloud-db/unicloud-db.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
//#endif
//#ifdef WEB || APP-IOS
const RealUniElementImpl = typeof UniElementImpl === 'undefined' ? class {} : UniElementImpl
export class /*#__PURE__*/ UniCloudDBElement extends RealUniElementImpl {
export class UniCloudDBElement extends RealUniElementImpl {
constructor(data : INodeData, pageNode : PageNode) {
super(data, pageNode);
const TagName = 'UNICLOUD-DB';
Expand Down Expand Up @@ -380,7 +380,7 @@
}
)
if (!this.manual && this.loadtime == LOAD_MODE_AUTO && this.dataList.length === 0) {
if (!this.manual && this.loadtime == LOAD_MODE_AUTO && this.dataList.length == 0) {
if (typeof this.collection == 'string') {
const collectionString = this.collection as string
if (collectionString.length == 0) {
Expand Down Expand Up @@ -483,7 +483,10 @@
}).catch((err : any | null) => {
this._requestFail(err, null)
options?.fail?.(err)
}).finally(() => {
}).then(() => {
this.loading = false
options?.complete?.()
}, () => {
this.loading = false
options?.complete?.()
})
Expand All @@ -496,7 +499,9 @@
this._isShowToast(options.showToast ?? false, options.toastTitle ?? 'add success')
}).catch((err) => {
this._requestFail(err, options.fail)
}).finally(() => {
}).then(() => {
this._requestComplete(options.complete, options.needLoading)
}, () => {
this._requestComplete(options.complete, options.needLoading)
})
},
Expand Down Expand Up @@ -541,7 +546,9 @@
this._isShowToast(options.showToast ?? false, options.toastTitle ?? 'update success')
}).catch((err : any | null) => {
this._requestFail(err, options.fail)
}).finally(() => {
}).then(() => {
this._requestComplete(options.complete, options.needLoading)
}, () => {
this._requestComplete(options.complete, options.needLoading)
})
},
Expand All @@ -560,7 +567,9 @@
}
}).catch((err : any | null) => {
this._requestFail(err, options.fail)
}).finally(() => {
}).then(() => {
this._requestComplete(options.complete, options.needLoading)
}, () => {
this._requestComplete(options.complete, options.needLoading)
})
},
Expand Down

0 comments on commit 27bcc92

Please sign in to comment.