All Projects → 2A5F → shadow

2A5F / shadow

Licence: MIT license
Shadow dom support for Vue

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
Vue
7211 projects
HTML
75241 projects

Projects that are alternatives of or similar to shadow

vue-drag-zone
Drag Zone component for @vuejs
Stars: ✭ 127 (+176.09%)
Mutual labels:  vue-components, vue-component, vue-directive
Vue Quill Editor
🍡@quilljs editor component for @vuejs
Stars: ✭ 6,874 (+14843.48%)
Mutual labels:  vue-components, vue-component, vue-directive
Vue Codemirror
⌨️ @codemirror component for @vuejs
Stars: ✭ 2,115 (+4497.83%)
Mutual labels:  vue-components, vue-component, vue-directive
Vue Awesome Swiper
🏆 Swiper component for @vuejs
Stars: ✭ 12,072 (+26143.48%)
Mutual labels:  vue-components, vue-component, vue-directive
Primevue
The Most Complete Vue UI Component Library
Stars: ✭ 1,085 (+2258.7%)
Mutual labels:  vue-components, vue-component
Vue Social Sharing
A renderless Vue.js component for sharing links to social networks, compatible with SSR
Stars: ✭ 1,071 (+2228.26%)
Mutual labels:  vue-components, vue-component
vue-img-orientation-changer
A vue plugin that can help you display image in correct orientation.
Stars: ✭ 38 (-17.39%)
Mutual labels:  vue-component, vue-directive
Vue Simple Upload
Simple File upload component for Vue.js
Stars: ✭ 100 (+117.39%)
Mutual labels:  vue-components, vue-component
Cheetah Grid
The fastest open-source data table for web.
Stars: ✭ 417 (+806.52%)
Mutual labels:  vue-components, vue-component
Vue Qrcode Reader
A set of Vue.js components for detecting and decoding QR codes.
Stars: ✭ 1,240 (+2595.65%)
Mutual labels:  vue-components, vue-component
Vue Parallax Js
Tiny vue component that adds a directive for parallax effect on elements.
Stars: ✭ 107 (+132.61%)
Mutual labels:  vue-components, vue-component
Vue Meeting Selector
This component is inspired from the meeting selector from doctolib with the power of Vuejs components.
Stars: ✭ 44 (-4.35%)
Mutual labels:  vue-components, vue-component
Vue Diagrams
Diagram component for vue.js, inspired by react-diagrams
Stars: ✭ 218 (+373.91%)
Mutual labels:  vue-components, vue-component
Vue Form Json Schema
Create forms using JSON schema. Bring your components!
Stars: ✭ 253 (+450%)
Mutual labels:  vue-components, vue-component
Vue Particles
Vue.js component for particles backgrounds ✨
Stars: ✭ 1,220 (+2552.17%)
Mutual labels:  vue-components, vue-component
Vue Touch Ripple
👆 Touch ripple component for @vuejs
Stars: ✭ 443 (+863.04%)
Mutual labels:  vue-components, vue-component
Xcui
🍴 A Vue.js 2.x desktop components colletion
Stars: ✭ 88 (+91.3%)
Mutual labels:  vue-components, vue-component
Quasar
Quasar Framework - Build high-performance VueJS user interfaces in record time
Stars: ✭ 20,090 (+43573.91%)
Mutual labels:  vue-components, vue-component
Vue Video Player
🎞 @videojs component for @vuejs
Stars: ✭ 4,026 (+8652.17%)
Mutual labels:  vue-components, vue-component
vue-virtualised
Blazing fast scrolling and updating for any amount of list and hierarchical data.
Stars: ✭ 18 (-60.87%)
Mutual labels:  vue-components, vue-component

Shadow

MIT
Shadow dom support for Vue

!!!!!!!!!! important !!!!!!!!!!

For vue2 use 1.x

npm i vue-shadow-dom@1

Usage

npm i vue-shadow-dom

<head>
  <script src="vue.js"></script>
  <script src="../path/to/shadow.global.js"></script>
  
  <script>
    const app = Vue.createApp(...)
    app.use(shadow)
  </script>
</head>

or

import shadow from 'vue-shadow-dom'

const app = Vue.createApp(...)
app.use(shadow)

Files

  • dist/shadow.global.js
    For UMD
    <script src="vue.js"></script>
    <script src="../path/to/shadow.global.js"></script>
  • dist/shadow.esm-browser.mjs | dist/shadow.esm-browser.prod.mjs
    For browser import, when Vue from global
    <script src="vue.js"></script>
    <link rel="modulepreload" href="../path/to/shadow.esm-browser.mjs" />
    <script type="module">
      import shadow from '../path/to/shadow.esm-browser.mjs'
    </script>
  • dist/shadow.cdn-jsdelivr.mjs | shadow.cdn-jsdelivr.prod.mjs
    For browser import, when Vue from cdn
    <link rel="modulepreload" href="https://cdn.jsdelivr.net/npm/vue@3/dist/vue.runtime.esm-browser.js" />
    <link rel="modulepreload" href="shadow.cdn-jsdelivr.mjs" />
    <script type="module">
      import shadow from 'shadow.cdn-jsdelivr.mjs'
    </script>
  • dist/shadow.esm-bundler.mjs | dist/shadow.esm-bundler.prod.mjs
    For packaging tool
    import shadow from '../path/to/shadow.esm-bundler.mjs'
  • dist/shadow.cjs.cjs | dist/shadow.cjs.prod.cjs
    For node cjs
    const shadow = require('../path/to/shadow.cjs.prod.cjs') 
  • shadow.js
    For node cjs
    const shadow = require('vue-shadow-dom') 
  • shadow.mjs
    For node esm
    import shadow from 'vue-shadow-dom'

<div v-shadow id=app>
  <input>
  <shadow-root>
    <div></div>
    <p>123</p>
  </shadow-root>
</div>

Will output

<div id="app">
 ▼ #shadow-root (open)
    <input><div>
   ▼ #shadow-root (open)
      <div></div>
      <p>123</p>
    </div>
  </div>

Api

  • <shadow-root>
    Usage:

    <shadow-root></shadow-root>

    Props

    • abstract

      • type: boolean
      • default: false

      it change the location of the #shadow-root
      it should not be dynamically changed

      default

      <article>
        <shadow-root><br></shadow-root>
      </article>
      <article><div>
        ▼ #shadow-root (open)
           <br>
        </article>

      abstract

      It will make other external tags unavailable

      <article>
        <shadow-root abstract><br></shadow-root>
      </article>
      <article>
       ▼ #shadow-root (open)
          <br>
        </article>
    • tag

      • type: string
      • default: 'div'
      <article>
        <shadow-root tag="section"><br></shadow-root>
      </article>
      <article><section>
        ▼ #shadow-root (open)
           <br>
         </section>
        </article>

    Expose

    const ex = ref<ShadowRootExpose>()
    <shadow-root ref="ex"></shadow-root>
    • shadow_root

      • type: ShadowRoot
      const shadow_root: ShadowRoot = ex.shadow_root
  • shadow-style
    Usage:

    <shadow-style></shadow-style>
    <!-- or -->
    <ShadowRoot.Style></ShadowRoot.Style>

    Same to html style

    The reason it exists is that vue SFC disabled style tag

  • v-shadow
    Deprecated

    Usage:

    <div v-shadow></div>
  • Experimental adoptedStyleSheets

    const adoptedStyleSheets = new CSSStyleSheet()
    adoptedStyleSheets.replace('p { color: green }')
    <shadow-root :adopted-style-sheets="[adoptedStyleSheets]">
      <p>test adoptedStyleSheets</p>
    </shadow-root>

    result: p is green

Build

npm i
npm run build

Test

npm run test:dev
npm run test:build
npm run test:preview
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].