Skip to content
forked from txs1992/v-outside

good click outside solution based on vue directives,很棒的基于 vue 指令的 click outside 解决方案。

Notifications You must be signed in to change notification settings

MMhui/v-outside

 
 

Repository files navigation

vue-focus-outside

使用

<template>
  <div id="app">
    <button v-focus-outside="focusOustsideHandler">点我啊</button>
    <iframe width="100%" height="300"></iframe>
  </div>
</template>
<script>
import Vue from 'vue'
import focusOutside from 'vue-focus-outside'

new Vue({
  el: '#app',
  directives: {
    focusOutside
  },
  methods: {
    focusOustsideHandler () {
      console.log('点击到按钮外面了。')
    }
  }
})
</script>

About

good click outside solution based on vue directives,很棒的基于 vue 指令的 click outside 解决方案。

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%