Gathering detailed insights and metrics for egg-view-vue-ssr
Gathering detailed insights and metrics for egg-view-vue-ssr
Gathering detailed insights and metrics for egg-view-vue-ssr
Gathering detailed insights and metrics for egg-view-vue-ssr
npm install egg-view-vue-ssr
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
96 Stars
96 Commits
13 Forks
5 Watchers
4 Branches
2 Contributors
Updated on Dec 16, 2024
Latest Version
3.3.3
Package Id
egg-view-vue-ssr@3.3.3
Unpacked Size
24.66 kB
Size
7.35 kB
File Count
11
NPM Version
6.9.0
Node Version
10.16.0
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
Vue Server Side Render Plugin for Egg.
1$ npm i egg-view-vue-ssr --save
https://www.yuque.com/easy-team/egg-vue
1// {app_root}/config/plugin.js 2exports.vuessr = { 3 enable: true, 4 package: 'egg-view-vue-ssr', 5};
1// {app_root}/config/config.default.js 2exports.vuessr = { 3 // layout: path.join(app.baseDir, 'app/view/layout.html'), 4 // manifest: path.join(app.baseDir, 'config/manifest.json'), 5 // injectCss: true, 6 // injectJs: true, 7 // fallbackToClient: true, // fallback to client rendering after server rendering failed 8 // afterRender: (html, ctx) => { 9 // return html; 10 // }, 11};
<!doctype html>
, you can set doctype: ''
1{ 2 "app/app.js": "/public/js/app/app.js", 3 "vendor.js": "/public/js/vendor.js", 4 "deps": { 5 "app/app.js": { 6 "js": [ 7 "/public/js/vendor.js", 8 "/public/js/app/app.js" 9 ], 10 "css": [ 11 "/public/css/vendor.css", 12 "/public/css/app.css" 13 ] 14 } 15 } 16}
render
when server render bundle error, will try client render**
1// controller/home.js 2exports.index = function* (ctx) { 3 yield ctx.render('index/index.js', { message: 'egg vue server side render'}); 4};
renderToHtml
when server render bundle error, will try client render**
1// controller/home.js
2exports.index = function* (ctx) {
3 const html = yield ctx.renderToHtml('index/index.js', { message: 'egg vue server side render'});
4 // you can process html
5 ctx.body = html;
6};
renderClient
, Use Vue render layoutwhen client render, render layout
exports.vuessr.layout
by Vue
1// controller/home.js
2exports.client = function* (ctx) {
3 yield ctx.renderClient('index/index.js',{ message: 'egg vue client render'});
4};
renderAsset
, Use render layout by viewEngine, default nunjucks
exports.vuessr.layout
by viewEngine, default use egg-view-nunjucks
egg-view-nunjucks
or egg-view-ejs
asset
object that can get js
, css
, state
information. layout template1// controller/home.js
2exports.asset = function* (ctx) {
3 yield ctx.renderAsset('index/index.js', { message: 'egg vue asset render'});
4};
1// controller/home.js
2exports.asset = function* (ctx) {
3 yield ctx.renderAsset('index/index.js', { message: 'egg vue asset render'}, { viewEngine: 'ejs' });
4};
Please open an issue here.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 0/26 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
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
project is not fuzzed
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