提交 fcbe5468 编写于 作者: H hdx

unicloud-db: 移除变量中的$开头字符, 编译器已优化element为不响应

上级 ced3881d
...@@ -35,19 +35,19 @@ ...@@ -35,19 +35,19 @@
collectionList: [ collectionList: [
db.collection('book').where('name == "水浒传"').getTemp(), db.collection('book').where('name == "水浒传"').getTemp(),
] as UTSJSONObject[], ] as UTSJSONObject[],
$uniCloudElement: null as UniCloudDBElement | null, uniCloudElement: null as UniCloudDBElement | null,
$isTesting: false, isTesting: false,
$addResult: {}, addResult: {},
$updateResult: {}, updateResult: {},
$removeResult: {} removeResult: {}
} }
}, },
onReady() { onReady() {
this.$uniCloudElement = this.$refs['udb'] as UniCloudDBElement this.uniCloudElement = this.$refs['udb'] as UniCloudDBElement
this.get(); this.get();
}, },
onPullDownRefresh() { onPullDownRefresh() {
this.$uniCloudElement!.loadData({ this.uniCloudElement!.loadData({
clear: true, clear: true,
success: (_ : UniCloudDBGetResult) => { success: (_ : UniCloudDBGetResult) => {
uni.stopPullDownRefresh() uni.stopPullDownRefresh()
...@@ -56,10 +56,10 @@ ...@@ -56,10 +56,10 @@
}, },
methods: { methods: {
loadMore() { loadMore() {
this.$uniCloudElement!.loadMore() this.uniCloudElement!.loadMore()
}, },
get() { get() {
this.$uniCloudElement!.loadData({ this.uniCloudElement!.loadData({
clear: true clear: true
}) })
}, },
...@@ -68,10 +68,10 @@ ...@@ -68,10 +68,10 @@
title: "title-" + Date.now(), title: "title-" + Date.now(),
comment: "comment" + Date.now() comment: "comment" + Date.now()
}; };
this.$uniCloudElement!.add(value, { this.uniCloudElement!.add(value, {
showToast: false, showToast: false,
success: (res : UniCloudDBAddResult) => { success: (res : UniCloudDBAddResult) => {
this.$addResult = { this.addResult = {
id: res.id id: res.id
}; };
this.get(); this.get();
...@@ -86,13 +86,13 @@ ...@@ -86,13 +86,13 @@
title: "title-" + Date.now(), title: "title-" + Date.now(),
comment: "comment" + Date.now() comment: "comment" + Date.now()
}; };
this.$uniCloudElement!.update(id, value, { this.uniCloudElement!.update(id, value, {
showToast: false, showToast: false,
needLoading: true, needLoading: true,
needConfirm: false, needConfirm: false,
loadingTitle: "正在更新...", loadingTitle: "正在更新...",
success: (res : UniCloudDBUpdateResult) => { success: (res : UniCloudDBUpdateResult) => {
this.$updateResult = { this.updateResult = {
updated: res.updated updated: res.updated
} }
}, },
...@@ -102,12 +102,12 @@ ...@@ -102,12 +102,12 @@
}) })
}, },
remove(id : string) { remove(id : string) {
this.$uniCloudElement!.remove(id, { this.uniCloudElement!.remove(id, {
showToast: false, showToast: false,
needConfirm: false, needConfirm: false,
needLoading: false, needLoading: false,
success: (res : UniCloudDBRemoveResult) => { success: (res : UniCloudDBRemoveResult) => {
this.$removeResult = { this.removeResult = {
deleted: res.deleted deleted: res.deleted
} }
}, },
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册