摘要:在当前项目的uniCloud-database目录上右键 "新建DB Schema" 填上要新建的表名字 table1.schema.json 在properties字段里 _id字段后面再追加字段 table1.schema.json // 文档教程: https://uniapp.dcloud.
阅读全文
摘要:先下载所有db schema 在前端代码中直接访问数据库表拿数据 index.vue <template> <view class="content"> <view v-for="item in dataList" :key="item._id"> {{item.name}} {{item.gend
阅读全文
摘要:在项目的uniCloud cloudfunctions文件夹上右键,新建云函数/云对象 单选框选择"云对象", 命名,创建 云对象代码 const db = uniCloud.database() module.exports = { _before: function() {}, // 定义云对象
阅读全文
摘要:<template> <view class="test2"> <view class="upload-group"> <view v-if="imagesUrl" class="box img" v-for="(item,idx) in imagesUrl"> <view class="box-c
阅读全文
摘要:由于uni-app独特的easycom技术,可以免引用、注册,直接使用各种符合规则的vue组件。 如果你没有创建uni-ui项目模板,也可以在你的工程里,通过 uni_modules 单独安装需要的某个组件 比如找到uni-icon的下载:https://ext.dcloud.net.cn/plug
阅读全文
摘要:uni-app前端代码 <template> <view class="home"> <view class="content"> <view class="item" v-for="item in articleList"> <view class="text"> <view class="tit
阅读全文
摘要:本地开发的云函数, 点击uniCloud-cloudfunctions,右键上传所有云函数... 在H5控制台,可以选择使用本地云函数,还是云端云函数 删除了本地云函数,或者换了电脑.可以点击uniCloud-cloudfunctions,右键下载所有云函数 打开云web控制台,可以在 "云函数 列
阅读全文
摘要:collection.doc(_id).remove() collection.where().remove() 删除之前一定要备份数据库表, 删除时一定要写正确查询条件. 云函数代码 'use strict'; exports.main = async (event, context) => {
阅读全文
摘要:云函数 // 修改用户记录 'use strict'; exports.main = async (event, context) => { const db = uniCloud.database() const dbCmd=db.command // let res=await db.colle
阅读全文
摘要:https://uniapp.dcloud.net.cn/uniCloud/cf-database.html#get-collection 前端代码 <template> <view class="db-demo"> <button type="primary" @click="addUser">插
阅读全文
摘要:打开uniCloud web控制台,在跨域配置里设置了当前网络的ip:prot 重启了HBuilderX 检查了关闭防火墙 都是只能读,不能写入数据库, 最后仔细打印阅读报错信息,才知道是每天读写有限度的. 写已将超出限度了,所以不能操作 "errMsg": "DB write action fai
阅读全文
摘要:uniCloud是什么? uniCloud是 DCloud 联合阿里云、腾讯云,为开发者提供的基于 serverless 模式和 js 编程的云开发平台 onLoad() { //前端不再用uni.request请求数据,而是调用云函数拿数据. uniCloud.callFunction({ nam
阅读全文