Socket
Socket
Sign inDemoInstall

@nextindex/vue-gdpr

Package Overview
Dependencies
11
Maintainers
3
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @nextindex/vue-gdpr

Render Components for GDPR Law


Version published
Weekly downloads
8
Maintainers
3
Install size
23.9 MB
Created
Weekly downloads
 

Readme

Source

vue-gdpr

Installation

npm install @nextindex/vue-gdpr --save

Notice

vue-gdpr is internally using dynamic import() statements to load the corrisponding langauge.json with the law text. As how webpack works, it will create vendor chunks because of the import(). Which sounds generally good, because it reduces the bundle size. However, webpack can't properly resolve these imports later in the project where you are using this lib. It will try to fetch the chunks based on the publicPath which in most project will be simply / . But the chunks are not automatically copied into it. So the loading of the chunks fails.

Currently the only workaround I've found is to publish the source files and let the user import the vue components from the source files. Which also means that bundling / transpiling needs to be done in user-land.

GitHub Issue: https://github.com/webpack/webpack/issues/11127

Setup

// THIS IS CURRENTLY NOT WORKING. SEE https://github.com/webpack/webpack/issues/11127
import { GDPRSidebar, GDPRContent } from '@nextindex/vue-gdpr'

Workaround

import GDPRSidebar from '@nextindex/vue-gdpr/src/components/GDPRSidebar.vue'
import GDPRContent from '@nextindex/vue-gdpr/src/components/GDPRContent.vue'

Components

  • <GDPRSidebar />
  • <GDPRContent />

Props

GDPRContent

PropTypeDefault ValueDescription
langStringdeGDRP Language. Currently supported: de
citationsBooleantrueShow / Hide citations
recitalsBooleantrueShow / Hide recitals

GDPRSidebar

PropTypeDefault ValueDescription
langStringdeGDRP Language. Currently supported: de
collapsibleBooleanfalseEnable/Disable Collapible sidebar items

Slots

GDPRSidebar

<GDPRSidebar>
    <template v-slot:chapter="{ chapter }">
        <h1>{{ chapter.title }}</h1>
    </template>
</GDPRSidebar>

Compiles and hot-reloads for development

npm run serve

Compiles and minifies for production

npm run build

Run your unit tests

npm run test:unit

Lints and fixes files

npm run lint

Customize configuration

See Configuration Reference.

FAQs

Last updated on 25 Aug 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc