@nanogiants/vue3-visible
This package contains a Vue 3 directive which adds v-visible. It differs from `v-if` (not in the DOM) and `v-show` (display: none) by that it sets the elements `visibility` style to `hidden`.
2,939
2
| Install | |
|---|---|
npm install @nanogiants/vue3-visible |
|
| Latest Version: | 1.0.8 |
| License: | MIT |
| Last Updated: | Aug 16, 2023 |
| Links: | GitHub · npm |
Maintainer: nanogiantsadmin
vue3-visible
This package contains a Vue 3 directive which adds v-visible.
It differs from v-if (not in the DOM) and v-show (display: none) by that it sets the elements visibility style to hidden.
Installation
npm i @nanogiants/vue3-visible
# or
yarn add @nanogiants/vue3-visible
Usage
// main.ts file
import { vVisible } from '@nanogiants/vue3-visible';
import App from './App.vue';
const app = createApp(App);
app.directive('visible', vVisible);
// component.ts
<template>
<div>
<div v-visible="true">Hello World!</div>
<div v-visible="false">Hello World!</div> // now has style `visibility: hidden`
</div>
</template>
args
There is only one arg you can pass.
The boolean value if the element is visible.
License
Related Packages
vue-on-click-outside
vue mixin/directive that does something when you click outside a container
169,297
31
Version History
| Version | Released | License |
|---|---|---|
| 1.0.8 | MIT | |
| 1.0.7 | MIT | |
| 1.0.6 | MIT | |
| 1.0.5 | MIT | |
| 1.0.4 | MIT | |
| 1.0.2 | MIT | |
| 1.0.1 |