Skip to content

Commit 0c6e7e7

Browse files
committed
chore: update ticket dashboard example. optimize for ssr
1 parent 54c5680 commit 0c6e7e7

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

app/components/content/Page/PageExTicketDashboard.vue

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
<template>
22
<div class="mx-auto h-[calc(100vh-57px)] max-w-screen-2xl">
3-
<UiSplitter direction="horizontal">
3+
<UiSplitter
4+
id="ticket-dashboard-splitter-group"
5+
direction="horizontal"
6+
@layout="layout = $event"
7+
>
48
<UiSplitterPanel
59
v-if="breakpoints.isGreaterOrEqual('md')"
10+
id="ticket-dashboard-splitter-panel-1"
611
v-slot="{ isCollapsed }"
712
collapsible
813
:collapsed-size="xlUp ? 4 : lg ? 5 : 8"
914
:min-size="xlUp ? 18 : lg ? 20 : 28"
10-
:default-size="xlUp ? 22 : lg ? 25 : 35"
15+
:default-size="layout[0]"
1116
:max-size="xlUp ? 26 : lg ? 30 : 40"
1217
class="group/splitter"
1318
>
@@ -38,8 +43,12 @@
3843
</nav>
3944
</UiScrollArea>
4045
</UiSplitterPanel>
41-
<UiSplitterHandle v-if="breakpoints.isGreaterOrEqual('md')" with-handle />
42-
<UiSplitterPanel>
46+
<UiSplitterHandle
47+
v-if="breakpoints.isGreaterOrEqual('md')"
48+
id="ticket-dashboard-splitter-handle-1"
49+
with-handle
50+
/>
51+
<UiSplitterPanel id="ticket-dashboard-splitter-panel-2" :default-size="layout[1]">
4352
<UiNavbar sticky>
4453
<UiContainer class="flex h-16 items-center justify-between lg:px-6">
4554
<div class="flex items-center gap-2">
@@ -228,8 +237,11 @@
228237
const lg = breakpoints.lg.value;
229238
const xlUp = breakpoints.isGreaterOrEqual("xl");
230239
const showMenu = ref(false);
240+
const period = useState("ticket-dashboard-period", () => "Yearly");
231241
232-
const period = ref("Yearly");
242+
const layout = useCookie<number[]>("ticket-dashboard-layout", {
243+
default: () => [xlUp ? 22 : lg ? 25 : 35, xlUp ? 78 : lg ? 75 : 65],
244+
});
233245
234246
// return the number formatted as K or M -> 1.2K or 1.2M
235247
const shortenCurrency = (v: number = 0) => {

0 commit comments

Comments
 (0)