This is an automated email from the ASF dual-hosted git repository.
nicholasjiang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/paimon-webui.git
The following commit(s) were added to refs/heads/main by this push:
new 4ceccec4 [Impovement] Support page caching (#384)
4ceccec4 is described below
commit 4ceccec40515b815f4255287bc9d97d9553bbb99
Author: yangyang zhong <[email protected]>
AuthorDate: Fri Jun 14 00:55:37 2024 +0800
[Impovement] Support page caching (#384)
---
paimon-web-ui/src/layouts/content/index.tsx | 13 ++++++++++++-
paimon-web-ui/src/views/playground/index.tsx | 15 +++++++++++++--
2 files changed, 25 insertions(+), 3 deletions(-)
diff --git a/paimon-web-ui/src/layouts/content/index.tsx
b/paimon-web-ui/src/layouts/content/index.tsx
index ad5f8419..8e5650fd 100644
--- a/paimon-web-ui/src/layouts/content/index.tsx
+++ b/paimon-web-ui/src/layouts/content/index.tsx
@@ -15,6 +15,7 @@ KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License. */
+import { KeepAlive } from 'vue'
import NavBar from './components/topbar'
import styles from './index.module.scss'
import SideBar from './components/sidebar'
@@ -66,7 +67,17 @@ export default defineComponent({
)
: null}
<n-layout-content content-style="height: calc(100vh - 64px);">
- <router-view />
+ <router-view v-slots={{
+ default: (props: any) => {
+ const Comp = props.Component
+ return (
+ <KeepAlive>
+ <Comp />
+ </KeepAlive>
+ )
+ },
+ }}
+ />
</n-layout-content>
</n-layout>
</n-layout>
diff --git a/paimon-web-ui/src/views/playground/index.tsx
b/paimon-web-ui/src/views/playground/index.tsx
index 7daf0524..bf4d0ce7 100644
--- a/paimon-web-ui/src/views/playground/index.tsx
+++ b/paimon-web-ui/src/views/playground/index.tsx
@@ -15,18 +15,29 @@ KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License. */
+import { KeepAlive } from 'vue'
import styles from './index.module.scss'
import Slider from './components/slider'
export default defineComponent({
name: 'PlaygroundPage',
- setup() {},
+ setup() { },
render() {
return (
<div class={styles.container}>
<Slider />
<div class={styles.content}>
- <router-view />
+ <router-view v-slots={{
+ default: (props: any) => {
+ const Comp = props.Component
+ return (
+ <KeepAlive>
+ <Comp />
+ </KeepAlive>
+ )
+ },
+ }}
+ />
</div>
</div>
)