Skip to content

Commit 70580cd

Browse files
committed
feat: PageHeader基础使用
1 parent 1469aac commit 70580cd

File tree

2 files changed

+63
-4
lines changed

2 files changed

+63
-4
lines changed

src/lib/divider/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export default {
6363
}
6464
6565
.jw-divider-line {
66-
background-color: rgb(239, 239, 245);
66+
background-color: #dcdfe6;
6767
6868
&.horizontal {
6969
height: 1px;

src/lib/page-header/index.vue

Lines changed: 62 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,71 @@
11
<template>
2-
<div class="jw-page-header"></div>
2+
<div class="jw-page-header">
3+
<div class="jw-page-header-left">
4+
<jw-icon class="jw-page-header-icon" :size="18" @click="handleBack">
5+
<component :is="icon" />
6+
</jw-icon>
7+
<div class="jw-page-header-title">{{ title }}</div>
8+
</div>
9+
<jw-divider direction="vertical" />
10+
<div class="jw-page-header-content">{{ content }}</div>
11+
</div>
312
</template>
413

5-
<script setup lang="ts"></script>
14+
<script setup lang="ts">
15+
import { ArrowBack } from "@vicons/ionicons5";
16+
const props = defineProps({
17+
icon: {
18+
type: Object,
19+
default: ArrowBack,
20+
},
21+
title: {
22+
type: String,
23+
default: "Back",
24+
},
25+
content: {
26+
type: String,
27+
default: "",
28+
},
29+
});
30+
31+
const emits = defineEmits(["back"]);
32+
33+
const handleBack = () => {
34+
emits('back')
35+
}
36+
</script>
637
<script lang="ts">
738
export default {
839
name: "jwPageHeader",
940
};
1041
</script>
1142

12-
<style scoped></style>
43+
<style lang="scss">
44+
.jw-page-header {
45+
display: flex;
46+
line-height: 24px;
47+
height: 24px;
48+
49+
align-items: center;
50+
font-size: 18px;
51+
52+
.jw-page-header-left {
53+
height: 100%;
54+
display: flex;
55+
cursor: pointer;
56+
margin-right: 10px;
57+
position: relative;
58+
59+
.jw-page-header-icon {
60+
height: 100%;
61+
display: flex;
62+
align-items: center;
63+
}
64+
}
65+
66+
.jw-page-header-content {
67+
margin-left: 10px;
68+
font-size: 18px;
69+
}
70+
}
71+
</style>

0 commit comments

Comments
 (0)