评论newData is not a function框输入内容之后发送不出去,发送按钮不管用
发送方法在post-comment.js里面
//提交用户评论
submitComment:function(event){
var newData={
username:"青石",
avatar:"https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1552921052251&di=8005020afa2e9232c0dcd5c78a0f6829&imgtype=0&src=http%3A%2F%2Fimage.biaobaiju.com%2Fuploads%2F20180803%2F21%2F1533303068-YzdjEqvFtK.jpg",
create_time:newData().getTime()/1000,
//评论内容
content:{
txt:this.data.keyboardInputValue
},
};
if(!newData.content.txt){
//如果没有评论内容,就不执行任何操作
return;
};
//保存新评论缓存到数据库中
this.dbPost.newComment(newData);
//显示操作结果
this.showCommitSuccessToast();
//重新渲染并绑定所有评论
this.bindCommentData();
//恢复初始状态
this.resetAllDefaultStatus();
},
报错截图
模拟器截图
相似问题