0.1.0 • Published 4 years ago

@ze-ui/vue-click-outside v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

ClickOutside

ClickOutside component for Vue.

Installation

$ npm install @ze/vue-click-outside
or
yarn add @ze/vue-click-outside

Example

<template>
  <div>
    <clickOutside @clickOutside="hide">
      <button  @click="toggle">Toggle</button>
    </clickOutside>
    <div  v-show="visible" style="background-color: palegreen;width: 100px; height: 100px"></div>
  </div>
</template>
<script>
export default {
  data () {
    return {
      visible: false
    }
  },
  methods: {
    toggle () {
      this.visible = true
    },

    hide () {
      this.visible = false
    }
  }

}
</script>

License

MIT