0.0.3 • Published 1 month ago

v-click-away v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month 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

1 month ago

0.0.2

1 month ago

0.0.1

1 month ago