vue-clickoutside

A Vue directive about listener a click outside an element.

MIT 6 个版本
安装
npm install vue-clickoutside
yarn add vue-clickoutside
pnpm add vue-clickoutside
bun add vue-clickoutside
README

vue-clickoutside

make a click outside event.

Similar vue-clickaway, but more simpler. :P

Installation

npm i vue-clickoutside -D

Demo

demo gif

Quick Start

import Vue from 'vue'
import VueClickoutside from 'vue-clickoutside'

Vue.use(VueClickoutside)

// or custom directive id
Vue.directive('v-clickoutside', VueClickoutside)
<div v-clickoutside="show = false" class="box">
  <button @click="show = true">click me</button>
  <div v-show="show">dropdown</div>
</div>

Development

If you using NPM 3.x, these will not be automatically installed.

  • jasmine-core *
  • phantomjs-prebuilt ^1.9

License

MIT

版本列表
0.2.0 2016-10-10
0.1.0 2016-06-17
0.0.4 2016-04-11
0.0.3 2016-04-11
0.0.2 2016-04-10
0.0.1 2016-04-08