├── .yarnrc.yml ├── .prettierrc ├── .gitignore ├── .editorconfig ├── example ├── index.js ├── index.html └── App.vue ├── vite.config.js ├── .babelrc ├── src ├── index.js └── vue-cookie-accept-decline.vue ├── LICENSE ├── docs ├── index.html └── assets │ ├── index.2f68f6de.css │ └── index.d553c29d.js ├── rollup.config.js ├── CHANGELOG.md ├── package.json ├── test └── VueCookieAcceptDecline.spec.js ├── dist ├── vue-cookie-accept-decline.min.js ├── vue-cookie-accept-decline.css ├── vue-cookie-accept-decline.esm.js └── vue-cookie-accept-decline.umd.js └── README.md /.yarnrc.yml: -------------------------------------------------------------------------------- 1 | enableTelemetry: false 2 | nodeLinker: node-modules 3 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 100, 3 | "semi": true, 4 | "singleQuote": true, 5 | "tabWidth": 2, 6 | "trailingComma": "all", 7 | "useTabs": false 8 | } 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | 4 | # https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored 5 | .pnp.* 6 | .yarn/* 7 | !.yarn/patches 8 | !.yarn/plugins 9 | !.yarn/releases 10 | !.yarn/sdks 11 | !.yarn/versions 12 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | indent_size = 2 7 | indent_style = space 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | -------------------------------------------------------------------------------- /example/index.js: -------------------------------------------------------------------------------- 1 | import { createApp } from 'vue'; 2 | import VueCookieAcceptDecline from '../src/index.js'; 3 | import App from './App.vue'; 4 | 5 | const app = createApp(App); 6 | 7 | app.component('vue-cookie-accept-decline', VueCookieAcceptDecline); 8 | 9 | app.mount('#app'); 10 | -------------------------------------------------------------------------------- /vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite'; 2 | import vue from '@vitejs/plugin-vue'; 3 | 4 | export default defineConfig({ 5 | base: '/vue-cookie-accept-decline/', // For GitHub docs support 6 | build: { 7 | outDir: '../docs', 8 | }, 9 | plugins: [vue()], 10 | root: 'example', 11 | }); 12 | -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | [ 4 | "@babel/preset-env", 5 | { 6 | "modules": false 7 | } 8 | ] 9 | ], 10 | "env": { 11 | "test": { 12 | "presets": [ 13 | [ 14 | "@babel/preset-env", 15 | { 16 | "targets": { 17 | "node": "current" 18 | } 19 | } 20 | ] 21 | ] 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | // Import vue component 2 | import component from './vue-cookie-accept-decline.vue'; 3 | 4 | export function install(app) { 5 | if (install.installed) return; 6 | 7 | install.installed = true; 8 | app.component('VueCookieAcceptDecline', component); 9 | } 10 | 11 | const plugin = { install }; 12 | 13 | // To auto-install when Vue is found 14 | let GlobalVue = null; 15 | if (typeof window !== 'undefined') { 16 | GlobalVue = window.Vue; 17 | } else if (typeof global !== 'undefined') { 18 | GlobalVue = global.Vue; 19 | } 20 | if (GlobalVue && 'use' in GlobalVue) { 21 | GlobalVue.use(plugin); 22 | } 23 | 24 | // To allow use as module (npm/webpack/etc.) export component 25 | export default component; 26 | 27 | // It's possible to expose named exports when writing components that can 28 | // also be used as directives, etc. - eg. import { RollupDemoDirective } from 'rollup-demo'; 29 | // export const RollupDemoDirective = component; 30 | -------------------------------------------------------------------------------- /example/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 11 | 12 |
6 |
7 |
8 |
9 |
10 |
11 |