Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/voltra/vue-gdpr-guard
Vue plugin to use gdpr-guard as efficiently and easily as possible
https://github.com/voltra/vue-gdpr-guard
components gdpr gdpr-guard hacktoberfest vue vue-plugin
Last synced: about 8 hours ago
JSON representation
Vue plugin to use gdpr-guard as efficiently and easily as possible
- Host: GitHub
- URL: https://github.com/voltra/vue-gdpr-guard
- Owner: Voltra
- License: mit
- Created: 2020-01-03T22:53:45.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-07-06T12:10:17.000Z (4 months ago)
- Last Synced: 2024-10-16T06:32:55.068Z (about 1 month ago)
- Topics: components, gdpr, gdpr-guard, hacktoberfest, vue, vue-plugin
- Language: JavaScript
- Homepage: https://voltra.github.io/vue-gdpr-guard
- Size: 2.95 MB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vue-gdpr-guard
`vue-gdpr-guard` is the Vue binding for the library `gdpr-guard`.
It exposes components as well as a plugin that allows to use `gdpr-guard` without the hassle of knowing how to wire you components.
It uses *~~almost~~* renderless components and scoped-slots in order to provide maximum customization.You can have a look at the [guide](https://voltra.github.io/vue-gdpr-guard/).
You can also have a look at this [code sandbox](https://codesandbox.io/embed/serverless-moon-fl5tc?fontsize=14&hidenavigation=1&theme=dark) to see a minimal example.## Example
MyComponent.vue
```vue
Enable all
Disable all
Group {{ group.name }}
{{ guard.name }}
import { GdprManager, GdprGroup, GdprGuard } from "vue-gdpr-guard"
export default {
components: {
GdprManager,
GdprGroup,
GdprGuard,
},
}```
index.js
```javascript
import { VueGdprGuard } from "vue-gdpr-guard"
import { GdprManagerBuilder } from "gdpr-guard"
import Vue from "vue"const factory = () => GdprManagerBuilder.make()
// [...]
.build();const savior = /* get/create a GdprSavior */;
Vue.use(VueGdprGuard, {
factory,
savior,
});// mount app
```## What is available?
### Components
`GdprManager`, `GdprGroup` and `GdprGuard` are renderless vue components that are available to you to compose your UI.
Note that these are not the classes from `gdpr-guard`, you can import these directly from that package
(`vue-gdpr-guard` has it in its dependencies).### Helpers
`VueGdprGuard` is the vue plugin to register in order to use the library.
Note that it requires a `factory` as well as a `savior` in its installation options.### Mixin
`gdprMixin` gives access to logic to handle the "options screen" in your app:
```typescript
// interface that describes the mixin
interface gdprMixin{
components: {
GdprManager: typeof GdprManager,
GdprGroup: typeof GdprGroup,
GdprGuard: typeof GdprGuard,
},
props: {
opened?: bool, // defaults to false
},
methods: {
enableAll: () => any,
disableAll: () => any,
close: () => any,
discard: () => Promise,
save: () => Promise,
},
}
```