Skip to content

Commit 4c19ea3

Browse files
committed
fix: 预渲染的时候执行page的onLoad方法传入一个空object避免组件使用query导致渲染失败。
1 parent 1896f21 commit 4c19ea3

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@monsterlee/remax-prerender-plugin",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "用于预渲染微信小程序的remax plugin",
55
"main": "index.js",
66
"scripts": {

prerender.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class Prerender {
5959
const page = this.vm.run(`
6060
const page = require('${this.getRealPath(path)}');
6161
page.setData = () => {};
62-
page.onLoad();
62+
page.onLoad({});
6363
module.exports = page;
6464
`, this.runScriptPath);
6565
return JSON.parse(JSON.stringify(page.container.root.toJSON()));

0 commit comments

Comments
 (0)