Skip to content

Commit

Permalink
fix: 预渲染的时候执行page的onLoad方法传入一个空object避免组件使用query导致渲染失败。
Browse files Browse the repository at this point in the history
  • Loading branch information
lee88688 committed Jul 7, 2021
1 parent 1896f21 commit 4c19ea3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@monsterlee/remax-prerender-plugin",
"version": "1.0.1",
"version": "1.0.2",
"description": "用于预渲染微信小程序的remax plugin",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion prerender.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class Prerender {
const page = this.vm.run(`
const page = require('${this.getRealPath(path)}');
page.setData = () => {};
page.onLoad();
page.onLoad({});
module.exports = page;
`, this.runScriptPath);
return JSON.parse(JSON.stringify(page.container.root.toJSON()));
Expand Down

0 comments on commit 4c19ea3

Please sign in to comment.