测试一: mounted (){ document.addEventListener('click',function(event){console.log(this.hasSearchHistory)}) }
测试二:
测试结果:
测试三:全局绑定事件与input focus 事件 中阻止冒泡失效