评论功能中点击发送按钮后如何让input框中的内容自动清空呢

这是组件:

        <zwz-comment :comments="comments" @comment-like="commentLike" @input="input" @send-comment="commentSend"
            v-model="commentText" @lower="lower" @reply="reply"></zwz-comment>
            
这是组件中:
<view class="comment-btm">
    <input type="text" :placeholder="placeholderComment" :focus="iptFocus" :value="value" @input="input"/>
        <button :type="commentText ? 'primary' : 'default'" @click="sendCourseComment(CommentId, superUserId, tier)">发送</button>
</view>
阅读 1.5k
1 个回答

v-model 綁定值,發送后賦值空字符。

推荐问题