Hides or shows elements depending of a criteria.
npm install --save @lewandy/vue-visibility
or
yarn add @lewandy/vue-visibility
import { createApp } from "vue";
import App from "./App.vue";
import VueVisibility from "@lewandy/vue-visibility";
const application = createApp(App);
application.use(VueVisibility);
application.mount("#app");
<script>
export default {
name: "App",
created() {
this.$root.$setVisibilityPermissions([121, 122, 123]);
},
};
</script>
<template>
<VueVisibilityProvider :identifier="124">
<template v-slot:placeholder>
<h2>You don't have access to see this.</h2>
</template>
<div class="card"><h2>CARD 1</h2></div>
</VueVisibilityProvider>
</template>
<template>
<div>
<div v-visibility="123" class="card">
<h2>CARD 2</h2>
</div>
</div>
</template>
Prop | Type | Required | Default |
---|---|---|---|
identifier | Any | true | null |
- Feature : Can disable elements and make it not clickable.
- Chore : Write basic tests
- Fork this repository.
- Create new branch with feature name.
- Go to example folder and run
npm install
andnpm run serve
. - The plugin sources files is located in /src/VueVisibility.js.
- Commit and set commit message with feature name.
- Push your code to your fork repository.
- Create pull request. 🙂
If you like this project, You can support me with starring ⭐ this repository.
Developed with ❤️ and ☕️ from the dominican republic 🌴