Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

你好,我想在collect中新增content但是数据库的content总是空的,希望可以指导一下,谢谢 #6

Closed
xy97518 opened this issue Oct 22, 2019 · 2 comments

Comments

@xy97518
Copy link

xy97518 commented Oct 22, 2019

getTextAreaContent: function (event) {
that.data.content = event.detail.value;
},

saveToCollectServer: function (event) {
db.collection('collect').add({
// data 字段表示需新增的 JSON 数据
data: {
_id: that.data.id,
date: new Date(),
user: that.data.user,
content: that.data.content ,
},
success:res=> {
that.refreshLikeIcon(true)
this.setData({
content: event.detail.value
})

  },
})

},

@YGragon
Copy link
Owner

YGragon commented Sep 28, 2020

看一下 that.data.content 是不是空的吧,还有检查 getTextAreaContent 方法是不是在 wxml 中定义的方法

@YGragon YGragon closed this as completed Nov 30, 2020
@YGragon
Copy link
Owner

YGragon commented Nov 30, 2020

close

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants