File tree 1 file changed +20
-1
lines changed
packages/effects/common-ui/src/page
1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change 1
1
<script setup lang="ts">
2
2
import type { Props } from ' ./page.ts' ;
3
3
4
+ import { computed , type CSSProperties } from ' vue' ;
5
+
4
6
import PageFooter from ' ./page-footer.vue' ;
5
7
import PageHeader from ' ./page-header.vue' ;
6
8
@@ -14,11 +16,28 @@ const props = withDefaults(defineProps<Props>(), {
14
16
showHeader: true ,
15
17
title: ' ' ,
16
18
});
19
+
20
+ const headerStyle = computed ((): CSSProperties => {
21
+ const { headerSticky } = props ;
22
+ if (! headerSticky ) {
23
+ return {};
24
+ }
25
+
26
+ return {
27
+ position: ' sticky' ,
28
+ top: 0 ,
29
+ zIndex: 99 ,
30
+ };
31
+ });
17
32
</script >
18
33
19
34
<template >
20
35
<div class =" relative h-full" >
21
- <PageHeader v-if =" props.showHeader" :title =" props.title" >
36
+ <PageHeader
37
+ v-if =" props.showHeader"
38
+ :style =" headerStyle"
39
+ :title =" props.title"
40
+ >
22
41
<template #default >
23
42
<slot name =" headerContent" ></slot >
24
43
</template >
You can’t perform that action at this time.
0 commit comments