39 lines
1.1 KiB
Markdown
39 lines
1.1 KiB
Markdown
# uni-app笔记
|
|
|
|
### uni-form
|
|
+ 表单需要设置验证规则,才能在提交后获取验证通过的值
|
|
|
|
### 弹窗
|
|
```javascript
|
|
uni.showToast({
|
|
title: '点击了悬浮按钮',
|
|
icon: 'none'
|
|
})
|
|
// 在屏幕中央显示提示消息
|
|
```
|
|
|
|
### 创建云对象
|
|
> 在uniCloud/cloudfunctions目录下右键选择创建云函数,选择云对象,
|
|
目录的名称即为云对象的名称,在目录下的index.obj.js文件创建方法或函数
|
|
|
|
### Error: Cannot find module 'uni-config-center'
|
|
> 在相对应的云函数目录右键管理公共模块及扩展,把uni-config-center勾选上确定即可
|
|
|
|
### err Error: 公共模块[uni-config-center]只能存在一个,删除不使用的公共模块后再试
|
|
> 错误原因:uniCloud/cloudfunctions/目录下存在uni_modules模块的文件,删除uni_modules模块的函数文件即可
|
|
|
|
### JQL语句在where中使用变量
|
|
> 函数中:`_id=="${var}"`
|
|
> 模板中: :"uid=='"+var+"'"
|
|
> 使用computed方法
|
|
```javascript
|
|
computed:{
|
|
where(){
|
|
return `_id=="${var}"`
|
|
}
|
|
}
|
|
//模板中写:
|
|
:where="where"
|
|
```
|
|
### JQL语句field查询指定字段
|
|
> field("字段1,字段2,字段3") 写在一个字符串内,用逗号分割字段 |