标签:his pre src cas tag hat 事件委托 html class
子组件的外层容器里添加个方法
sendEmoji(e) { //console.log(e); //发送给父组件 this.$emit("sendEmoji", e); }
父组件中
<div ref="emoji"> <emoji :getEmoji="getEmoji" ref="emoji" @sendEmoji="sendEmoji"/> </div>
//点击表情框表情 sendEmoji(e) { //console.log(e) let target = e.target || e.srcElement; if (!!target && target.tagName.toLowerCase() === "span") { this.chatValue += target.innerHTML; } e.stopPropagation(); },
标签:his pre src cas tag hat 事件委托 html class
原文地址:https://www.cnblogs.com/kimm/p/10660660.html