Gathering detailed insights and metrics for vue-load-script-plus
Gathering detailed insights and metrics for vue-load-script-plus
Gathering detailed insights and metrics for vue-load-script-plus
Gathering detailed insights and metrics for vue-load-script-plus
npm install vue-load-script-plus
Typescript
Module System
Node Version
NPM Version
69.1
Supply Chain
98.7
Quality
76.2
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
24,961
Last Day
1
Last Week
27
Last Month
208
Last Year
3,259
9 Stars
41 Commits
2 Forks
2 Watching
2 Branches
2 Contributors
Minified
Minified + Gzipped
Latest Version
1.6.6
Package Id
vue-load-script-plus@1.6.6
Unpacked Size
8.96 kB
Size
2.87 kB
File Count
4
NPM Version
6.12.0
Node Version
12.13.0
Cumulative downloads
Total Downloads
Last day
-91.7%
1
Compared to previous day
Last week
-51.8%
27
Compared to previous week
Last month
-1%
208
Compared to previous month
Last year
-29%
3,259
Compared to previous year
No dependencies detected.
This project is inspired by vue-plugin-load-script, add some new features on it,if you don't need the new features you could use vue-plugin-load-script.
npm install vue-load-script-plus --save
npm install vue-load-script-plus@1.6.6 -S
1const arr = [ 2 { 3 script: 'https://cdn.bootcss.com/jquery/3.3.1/core.js', 4 beforeBody: true, // load before body tag closes 5 attrObject: { 6 'data-appid': 'APPID', 7 'data-redirecturi': 'REDIRECTURI', 8 'charset': 'utf-8' 9 } 10 },// first script loaded 11 { 12 script: 'https://cdn.bootcss.com/jquery/3.3.1/core.js', 13 beforeBody: false, // load in head tag 14 attrObject: { 15 'data-appid': 'APPID', 16 'data-redirecturi': 'REDIRECTURI', 17 'charset': 'utf-8' 18 } 19 } // then second script loaded 20 ] 21this.$unBlockloadAllScriptsAndAttr(arr) 22 .then(() => { 23 // after all loaded, do your logic 24 }) 25 .catch(() => { 26 // after all loaded, do your logic 27 })
1// main.js 2import Vue from 'vue' 3import VueLoadScript from 'vue-load-script-plus' 4Vue.use(VueLoadScript)
1// someComponent.vue 2<template> 3<button @click="removeScriptTag"></button> 4</template> 5<script> 6export default { 7 mounted () { 8 // load your script tag, if you 9 // don't need to set attributes on script tag. 10 // you can stop passing the second parameter 11 this.$loadScript( 12 'http://qzonestyle.gtimg.cn/qzone/openapi/qc_loader.js', 13 { 14 'data-appid': 'APPID', 15 'data-redirecturi': 'REDIRECTURI', 16 'charset': 'utf-8' 17 } 18 ).then(() => { 19 // do your logic 20 }) 21 }, 22 methods: { 23 // remove script tag from head 24 removeScriptTag () { 25 this.$unloadScript('http://qzonestyle.gtimg.cn/qzone/openapi/qc_loader.js') 26 } 27 } 28} 29</script> 30// generated script tag would be 31// <script 32 type="text/javascript" 33 async="" 34 src="http://qzonestyle.gtimg.cn/qzone/openapi/qc_loader.js" 35 data-appid="APPID" 36 data-redirecturi="REDIRECTURI" 37 charset="utf-8"></script>
It will load an array of scripts, all of the scripts will be loaded,no matter some of them was 404 or 301
1 2const arr = [ 3 'https://cdn.bootcss.com/jquery/3.3.1/core.js', // first script loaded 4 'https://cdn.bootcss.com/jquery/3.3.1/jquery.js' // then second script loaded 5 ] 6this.$unBlockloadAllScripts(arr) 7 .then(() => { 8 // after all loaded, do your logic 9 }) 10 .catch(() => { 11 // after all loaded, do your logic 12 })
I suggest you to write your logic both in the then and catch callback, to ensure that your own logic are excuted. The script tags will be loaded in the order of its order in the array.
It will load script after it was unloaded
1 this.$loadAfterUnloadScript( 2 'http://qzonestyle.gtimg.cn/qzone/openapi/qc_loader.js', 3 { 4 'data-appid': 'APPID', 5 'data-redirecturi': 'REDIRECTURI', 6 'charset': 'utf-8' 7 } 8 ).then(() => { 9 // do your logic 10 })
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 1/30 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- 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
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-12-23
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