Skip to content

Commit

Permalink
fix: restore renderVueClient body set
Browse files Browse the repository at this point in the history
  • Loading branch information
hubcarl committed Dec 18, 2018
1 parent fab037d commit af7ab19
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
16 changes: 8 additions & 8 deletions app/extend/context.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
'use strict';
module.exports = {
renderClient(name, locals, options) {
return this.renderVueClient(name, locals, options).then(html => {
this.body = html;
});
return this.renderVueClient(name, locals, options);
},
renderAsset(name, locals, options) {
return this.renderVueAsset(name, locals, options).then(html => {
this.body = html;
});
return this.renderVueAsset(name, locals, options);
},
renderVueAsset(name, locals, options) {
return this.app.vue.renderAsset(this, name, locals, options);
return this.app.vue.renderAsset(this, name, locals, options).then(html => {
this.body = html;
});
},
renderVueClient(name, locals, options = {}) {
locals = this.app.vue.normalizeLocals(this, locals, options, false);
return this.app.vue.renderClient(name, locals, options);
return this.app.vue.renderClient(name, locals, options).then(html => {
this.body = html;
});
},
};

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "egg-view-vue-ssr",
"version": "3.2.0",
"version": "3.2.1",
"description": "vue server side render solution for egg",
"eggPlugin": {
"name": "vuessr"
Expand Down
4 changes: 2 additions & 2 deletions test/fixtures/apps/view-vue-ssr-test/app/controller/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ exports.renderClient = function* (ctx) {
};

exports.renderVueClient = function* (ctx) {
this.body = yield ctx.renderVueClient('test/test.js', { message: 'vue server side render!' });
yield ctx.renderVueClient('test/test.js', { message: 'vue server side render!' });
};

exports.renderAsset = function* (ctx) {
yield ctx.renderAsset('app/app.js', { title: 'renderAsset', message: 'vue server side render!' }, { layout: path.join(ctx.app.baseDir, 'app/view/layout_asset.html')});
};

exports.renderVueAsset = function* (ctx) {
this.body = yield ctx.renderVueAsset('app/app.js', { title: 'renderAsset', message: 'vue server side render!' }, { layout: path.join(ctx.app.baseDir, 'app/view/layout_asset.html')});
yield ctx.renderVueAsset('app/app.js', { title: 'renderAsset', message: 'vue server side render!' }, { layout: path.join(ctx.app.baseDir, 'app/view/layout_asset.html')});
};

0 comments on commit af7ab19

Please sign in to comment.