Gathering detailed insights and metrics for @vgerbot/vuepress-plugin-demo-block
Gathering detailed insights and metrics for @vgerbot/vuepress-plugin-demo-block
npm install @vgerbot/vuepress-plugin-demo-block
Typescript
Module System
Node Version
NPM Version
JavaScript (93.03%)
Less (6.63%)
Shell (0.34%)
Total Downloads
15,697
Last Day
3
Last Week
37
Last Month
279
Last Year
3,980
79 Commits
1 Watching
9 Branches
1 Contributors
Latest Version
0.8.1
Package Id
@vgerbot/vuepress-plugin-demo-block@0.8.1
Unpacked Size
49.03 kB
Size
13.09 kB
File Count
5
NPM Version
6.14.17
Node Version
14.20.1
Publised On
28 Jan 2023
Cumulative downloads
Total Downloads
Last day
-62.5%
3
Compared to previous day
Last week
-41.3%
37
Compared to previous week
Last month
-23.6%
279
Compared to previous month
Last year
-11.1%
3,980
Compared to previous year
The Demo Block is used to help you add vue, react or native js examples when writing a document. When writing component documentation, you usually need to add some related examples to the document. These examples can usually be implemented using JSFiddle or Codepen's Iframe, but the maintenance cost will be relatively high. You can quickly add examples by using Demo Block, and it is very convenient to modify.
To show how to write the example, the three points used to mark the end of the code section are separated by spaces, and the spaces need to be removed when used.
This version adds delayed loading and injection of source code features.
Reference official document Vuepress
npm i vuepress-plugin-demo-block --save-dev
config.js
1module.exports = { 2 head: [ 3 ['script', { src: 'https://cdn.jsdelivr.net/npm/react/umd/react.production.min.js' }], 4 ['script', { src: 'https://cdn.jsdelivr.net/npm/react-dom/umd/react-dom.production.min.js' }], 5 ['script', { src: 'https://cdn.jsdelivr.net/npm/vue/dist/vue.min.js' }], 6 ['script', { src: 'https://cdn.jsdelivr.net/npm/@babel/standalone/babel.min.js' }], 7 ], 8 plugins: [ 9 'demo-block' 10 ] 11} 12
Write the following code in the Markdown file:
1::: demo 2```html 3<template> 4 <div class="box-vue">Vue {{ message }}</div> 5</template> 6<script> 7export default { 8 data: () => ({ message: 'Hello World' }) 9} 10</script> 11<style> 12.box-vue { color: red; } 13</style> 14` ` ` <= delete spaces here 15:::
1::: demo [react] 2```js 3export default class App extends React.Component { 4 constructor (props) { 5 super(props) 6 this.state = { message: 'Hello World' } 7 } 8 render () { 9 return ( 10 <div className="box-react"> 11 React {this.state.message} 12 </div> 13 ) 14 } 15} 16App.__style__ = ` 17 .box-react { color: red; } 18` 19` ` ` <= delete spaces here 20:::
1::: demo [vanilla] 2```html 3<html> 4 <div id="vanilla-box"></div> 5</html> 6<script> 7 var box = document.getElementById('vanilla-box') 8 box.innerHTML = 'Hello World!' 9</script> 10<style> 11#vanilla-box { 12 color: red; 13} 14</style> 15` ` ` 16:::
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
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
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
121 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-01-20
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