diff --git a/README.md b/README.md index 9a2f0f4..5d8b0dd 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Is *web-component* library missing something ? No problem! Simply [fork](https://github.com/vardius/web-component/network#fork-destination-box) this repository, [add middleware](https://github.com/vardius/web-component/wiki/Middleware) and create pull request. -## Instaliation +## Installation ```bash npm install --save web-component @@ -37,7 +37,8 @@ import { WebComponent } from 'web-component' template: require('./hello-world.html'),// provide template styles: require('./hello-world.css'), //provide styles extends: 'button', //default does not extends any - shadowDOM: true //default false + shadowDOM: true, //default false + mode: "open" // default open, set to closed to block access to shadowDOM }) export class HelloWorld extends HTMLElement {} ``` diff --git a/src/connectedCallback/index.js b/src/connectedCallback/index.js index 5bc0833..fb55110 100644 --- a/src/connectedCallback/index.js +++ b/src/connectedCallback/index.js @@ -10,7 +10,7 @@ export default options => original => { let shadowRoot = target.shadowRoot; if (!shadowRoot) { shadowRoot = target.attachShadow({ - mode: "open" + mode: options.mode ? options.mode : "open" }); } target = shadowRoot;