为什么云开发成功插入数据了,但是在控制台查看数据库会返回为空呢?

小程序 文章 2022-03-08 09:40 330 0 全屏看文

AI助手支持GPT4.0

为什么云开发成功插入数据了,但是在控制台查看数据库会返回为空呢?Why does cloud development successfully insert data, but the database returns empty when viewed in the console?

为什么云开发成功插入数据了,但是在控制台查看数据库会返回为空呢?

前面是样式,后面是代码,请大佬帮忙看看

The front is the style and the back is the code. Please look at it with the help of the boss

回答:

八九:

开心由我:

你那let的变量跟你setData的变量不是同一个,setData的变量只会设置

page({  data:{    account:'',    password:''  } })

像上面那位大哥写的就可以,所以你改变的只是this.data里面变量的值,你自己定义的let那些变量还是空的没变

Mr.Zhao:
DB.add({  data: {    account: this.data.account,    password: this.data.password  }})

-EOF-

AI助手支持GPT4.0