0.0.3 • Published 2 months ago

v-click-away v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

Intro

Yep. Yet another Vue click-away directive.

Install

npm i v-click-away

Usage

<MyModal :open="isModalOpen" v-click-away="isModalOpen = false">
  ...
</MyModal>

If an element that triggers the modal to open is not a child of the modal, sometimes the modal won't open because clicking the open triggers it to close! In this scenario, use the directive's arg to select a trigger element (by id):

<button id="button-id">Open Modal</button>
<MyModal :open="isModalOpen" v-click-away:['button-id']="isModalOpen = false">
  ...
</MyModal>
0.0.3

2 months ago

0.0.2

2 months ago

0.0.1

2 months ago