<view class="footer-center">
<input class="input-text" type="text" @confirm="sendMessge" v-model="inputValue" :focus="focus" @blur="blur" :placeholder="placeholder"></input>
</view>
<view class="footer-right">
<button id='msg-type' class="send-comment" @tap="sendMessge">发送</button>
</view>
sendMessge: function () {
console.log(this.inputValue)
if (!this.inputValue) {
uni.showModal({
content:"还没有输入内容哦!",
showCancel:false
})
return;
}
var that = this;
//点击发送按钮时,通知父组件用户输入的内容
this.$emit('send-message', {
type: 'text',
content: that.inputValue
});
that.inputValue = '';//清空上次输入的内容
}
<chat-input @send-message="send_comment" @blur="blur" :focus="focus" :placeholder="input_placeholder"></chat-input>```
2 个回复
keledjh (作者)
小程序点击鼠标有效,H5点击鼠标无效
keledjh (作者)
搞好了,这里没有高人
m***@163.com
我也遇到评论的时候点击发送没反应, 大佬这是什么原因
2020-10-13 11:25