vue-focus-outside
使用
<template> <div id="app"> <button v-focus-outside="focusOustsideHandler">点我啊</button> <iframe width="100%" height="300"></iframe> </div></template><script> el: '#app' directives: focusOutside methods: { console } </script>