Gathering detailed insights and metrics for vue-portal-class
Gathering detailed insights and metrics for vue-portal-class
Gathering detailed insights and metrics for vue-portal-class
Gathering detailed insights and metrics for vue-portal-class
Render children into a DOM node that exists outside the DOM hierarchy of the parent component
npm install vue-portal-class
Typescript
Module System
Node Version
NPM Version
JavaScript (83.81%)
Vue (16.19%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
6 Commits
1 Watchers
1 Branches
1 Contributors
Updated on Nov 08, 2018
Latest Version
0.0.4
Package Id
vue-portal-class@0.0.4
Unpacked Size
17.54 kB
Size
3.47 kB
File Count
7
NPM Version
6.1.0
Node Version
10.2.1
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
1
4
Portals provide a first-class way to render children into a DOM node that exists outside the DOM hierarchy of the parent component.
1import Portal from '../src/Portal'; 2import { cloneVNode } from './VueHelper'; 3 4export default { 5 name: 'PortalExample', 6 props: { 7 showPortal: { 8 type: Boolean, 9 default: false 10 } 11 }, 12 13 methods: { 14 renderPortal(h) { 15 if(!this.showPortal) { 16 return null; 17 } 18 19 return cloneVNode(this.$slots.default, h); 20 } 21 }, 22 23 beforeMount() { 24 // Portal will be attach to div#portal-root 25 // If no node is found, Portal will create div#portal-root 26 // at the end of document.body 27 this.portal = new Portal('portal-root', this.renderPortal); 28 29 // Or you may pass an element 30 /* 31 const root = document.createElement('div') 32 root.setAttribute('id', 'fresh-root'); 33 document.body.append(root); // You may bind it to something else than body 34 this.portal = new Portal(root, this.renderPortal); 35 */ 36 37 // this.portal = new Portal(document.querySelector('.other-portal-root'), this.renderPortal); 38 }, 39 40 destroyed() { 41 // It will destroy the portal if no other components is using it 42 this.portal.unmount(); 43 }, 44 45 render(h) { 46 // Trigger the portal renderer 47 this.portal.update(); 48 49 return h('div', 'I am rendering with the normal flow without portal'); 50 } 51}
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no SAST tool detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/6 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
18 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More