|
@@ -101,6 +101,7 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+import { Toast } from "vant";
|
|
export default {
|
|
export default {
|
|
name: "page-learn-content",
|
|
name: "page-learn-content",
|
|
props: {
|
|
props: {
|
|
@@ -235,7 +236,13 @@ export default {
|
|
// 操作:发布评论
|
|
// 操作:发布评论
|
|
postCommentFun() {
|
|
postCommentFun() {
|
|
// TODO...
|
|
// TODO...
|
|
- console.log("操作:发布评论", this.commentValue);
|
|
|
|
|
|
+ let inputVal = this.commentValue.replace(/(^\s*)|(\s*$)/g, ""); // 去掉两端空格
|
|
|
|
+ if (!inputVal.length) {
|
|
|
|
+ Toast("未填写有效评论,无法发布");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ Toast("发布评论成功");
|
|
|
|
+ this.canclePostCommentFun(); // 置空输入框
|
|
},
|
|
},
|
|
// 操作:取消评论
|
|
// 操作:取消评论
|
|
canclePostCommentFun() {
|
|
canclePostCommentFun() {
|