From e75a531423a5e320aa9ac43b961a450d511cd4c4 Mon Sep 17 00:00:00 2001 From: howel52 Date: Tue, 7 Apr 2020 15:54:27 +0800 Subject: [PATCH] :pencil: complete purehtml demo --- docs/faq/README.md | 7 ++++++- docs/zh/faq/README.md | 7 ++++++- examples/purehtml/entry.js | 7 ++++++- examples/purehtml/index.html | 3 +++ 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/docs/faq/README.md b/docs/faq/README.md index dc7839049..fe475a098 100644 --- a/docs/faq/README.md +++ b/docs/faq/README.md @@ -168,6 +168,11 @@ example: 2. export lifecycles in the entry ```javascript +const render = ($) => { + $('#purehtml-container').html("Hello, render with jQuery"); + return Promise.resolve(); +} + (global => { global['purehtml'] = { bootstrap: () => { @@ -176,7 +181,7 @@ example: }, mount: () => { console.log('purehtml mount'); - return Promise.resolve(); + return render($) }, unmount: () => { console.log('purehtml unmount'); diff --git a/docs/zh/faq/README.md b/docs/zh/faq/README.md index 38ae44d65..922c4990f 100644 --- a/docs/zh/faq/README.md +++ b/docs/zh/faq/README.md @@ -250,6 +250,11 @@ qiankun 2.0 版本将提供一种更智能的方式使其自动化。 2. 在 entry js 里声明 lifecycles ```javascript +const render = ($) => { + $('#purehtml-container').html("Hello, render with jQuery"); + return Promise.resolve(); +} + (global => { global['purehtml'] = { bootstrap: () => { @@ -258,7 +263,7 @@ qiankun 2.0 版本将提供一种更智能的方式使其自动化。 }, mount: () => { console.log('purehtml mount'); - return Promise.resolve(); + return render($); }, unmount: () => { console.log('purehtml unmount'); diff --git a/examples/purehtml/entry.js b/examples/purehtml/entry.js index 85143f23a..f4172cb83 100644 --- a/examples/purehtml/entry.js +++ b/examples/purehtml/entry.js @@ -1,3 +1,8 @@ +const render = $ => { + $('#purehtml-container').html('Hello, render with jQuery'); + return Promise.resolve(); +}; + (global => { global['purehtml'] = { bootstrap: () => { @@ -6,7 +11,7 @@ }, mount: () => { console.log('purehtml mount'); - return Promise.resolve(); + return render($); }, unmount: () => { console.log('purehtml unmount'); diff --git a/examples/purehtml/index.html b/examples/purehtml/index.html index f1db0977b..6c599f686 100644 --- a/examples/purehtml/index.html +++ b/examples/purehtml/index.html @@ -4,11 +4,14 @@ Purehtml Example +
Purehtml Example
+
\ No newline at end of file