阻止冒泡

This commit is contained in:
bjzhoujian
2025-11-25 15:07:09 +08:00
parent 7368fa7a8c
commit 4ca01ba233
2 changed files with 11 additions and 2 deletions

View File

@@ -56,7 +56,13 @@ export default {
}
},
methods: {
handleSend() {
handleSend(event) {
// 阻止事件的默认行为和冒泡
if (event) {
event.preventDefault();
event.stopPropagation();
console.log('preventDefault');
}
console.log('handleSend');
if (!this.inputContent.trim() || this.disabled) return
// 添加用户消息到列表