From 57ebc434ba323478d2ad9383fa60d6a436178ff3 Mon Sep 17 00:00:00 2001 From: Xc Date: Tue, 10 Dec 2024 19:01:59 +0800 Subject: [PATCH] =?UTF-8?q?ComponentOption=E4=B8=AD=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E4=BA=86stale=E9=85=8D=E7=BD=AE=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- es/page.mp.js | 6 ++++-- es/page.react.js | 8 ++++++-- es/types/Page.d.ts | 1 + lib/page.mp.js | 6 ++++-- lib/page.react.js | 8 ++++++-- lib/types/Page.d.ts | 1 + src/page.mp.ts | 6 ++++-- src/page.react.tsx | 8 ++++++-- src/types/Page.ts | 1 + 9 files changed, 33 insertions(+), 12 deletions(-) diff --git a/es/page.mp.js b/es/page.mp.js index 71eeca4b..e37825df 100644 --- a/es/page.mp.js +++ b/es/page.mp.js @@ -482,7 +482,7 @@ const oakBehavior = Behavior({ this.oakOption.lifetimes?.ready && this.oakOption.lifetimes?.ready.call(this); const { oakFullpath } = this.state; - if (oakFullpath && + if (oakFullpath && !this.oakOption.stale && !this.features.runningTree.checkIsModiNode(oakFullpath) && !this.features.runningTree.isListDescandent(oakFullpath)) { this.refresh(); @@ -787,7 +787,9 @@ export function createComponent(option, features) { return; } const { oakFullpath } = this.state; - if (oakFullpath && !features.runningTree.checkIsModiNode(oakFullpath) && !features.runningTree.isListDescandent(oakFullpath)) { + if (oakFullpath && !option.stale && + !features.runningTree.checkIsModiNode(oakFullpath) && + !features.runningTree.isListDescandent(oakFullpath)) { try { await this.refresh(); } diff --git a/es/page.react.js b/es/page.react.js index 6d6df787..aab3b76b 100644 --- a/es/page.react.js +++ b/es/page.react.js @@ -643,7 +643,9 @@ export function createComponent(option, features) { } try { const { oakFullpath } = this.state; - if (oakFullpath && !features.runningTree.checkIsModiNode(oakFullpath) && !features.runningTree.isListDescandent(oakFullpath)) { + if (oakFullpath && !option.stale && + !features.runningTree.checkIsModiNode(oakFullpath) && + !features.runningTree.isListDescandent(oakFullpath)) { await this.refresh(); } else { @@ -701,7 +703,9 @@ export function createComponent(option, features) { lifetimes?.show && lifetimes.show.call(this); } const { oakFullpath } = this.state; - if (oakFullpath && !features.runningTree.checkIsModiNode(oakFullpath) && !features.runningTree.isListDescandent(oakFullpath)) { + if (oakFullpath && !option.stale && + !features.runningTree.checkIsModiNode(oakFullpath) && + !features.runningTree.isListDescandent(oakFullpath)) { this.refresh(); } else { diff --git a/es/types/Page.d.ts b/es/types/Page.d.ts index cc293a2f..986dabc8 100644 --- a/es/types/Page.d.ts +++ b/es/types/Page.d.ts @@ -41,6 +41,7 @@ interface ComponentOption