@ze-ui/vue-click-outside

0.1.0 • Public • Published

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

Package Sidebar

Install

npm i @ze-ui/vue-click-outside

Weekly Downloads

1

Version

0.1.0

License

MIT

Unpacked Size

115 kB

Total Files

12

Last publish

Collaborators

  • luozejian