Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
fcbe5468
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
6022
Star
91
Fork
164
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
18
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello uni-app x
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
18
Issue
18
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
fcbe5468
编写于
6月 25, 2024
作者:
H
hdx
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
unicloud-db: 移除变量中的$开头字符, 编译器已优化element为不响应
上级
ced3881d
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
15 addition
and
15 deletion
+15
-15
pages/component/unicloud-db/unicloud-db.uvue
pages/component/unicloud-db/unicloud-db.uvue
+15
-15
未找到文件。
pages/component/unicloud-db/unicloud-db.uvue
浏览文件 @
fcbe5468
...
@@ -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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录