聯系官方銷售客服
1835022288
028-61286886
在測試小程序問答回帖時,總出現“評論內容不能為空”求助!
我的API接口是:
// 提交評論 postCommentUrl: function(id) { return CMS_API + '&s=wenda&m=post&c=comment&api_auth_code=' + wx.getStorageSync('member_auth') + '&api_auth_uid=' + wx.getStorageSync('member_uid') + '&id=' + id; },
我的前端代碼是:
<div class="comment-input"> <input v-model="newComment" placeholder="請輸入評論內容" class="input-box" /> <button @tap="submitComment" class="submit-btn">提交</button> </div> </div>
JS部分:
// 提交評論 submitComment() { var self = this; if (self.newComment.trim() === "") { wx.showToast({ title: "評論內容不能為空", icon: "none", }); return; }
請教具體怎么弄?回復@湖北人
備注解決方法:dayrui\App\Wenda\Controllers\Comment.php
改為以下代碼: