Skip to content

Commit 92db0fa

Browse files
committed
feat: Alert 自定义文案描述
1 parent da6d4a8 commit 92db0fa

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed

src/lib/alert/index.vue

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@
3939

4040
<div class="jw-alert-body">
4141
<div class="jw-alert-body-title">{{ title }}</div>
42-
<div class="jw-alert-body-content"></div>
42+
<div class="jw-alert-body-content" v-if="description">
43+
{{ description }}
44+
</div>
4345
</div>
4446
</div>
4547
</template>
@@ -53,7 +55,7 @@ import { CloseCircle } from "@vicons/ionicons5";
5355
const props = defineProps({
5456
title: {
5557
type: String,
56-
default: "",
58+
default: "Title",
5759
},
5860
description: {
5961
type: String,
@@ -93,6 +95,7 @@ export default {
9395
opacity: 1;
9496
display: flex;
9597
align-items: center;
98+
align-items: flex-start;
9699
transition: opacity 0.2s;
97100
98101
&.is-center {
@@ -101,6 +104,8 @@ export default {
101104
102105
.jw-alert-icon {
103106
margin-right: 10px;
107+
height: 100%;
108+
display: flex;
104109
}
105110
.jw-alert-body {
106111
.jw-alert-body-title {
@@ -110,6 +115,12 @@ export default {
110115
font-weight: 500;
111116
color: rgb(31, 34, 37);
112117
}
118+
.jw-alert-body-content {
119+
transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
120+
margin-top: 9px;
121+
font-size: 14px;
122+
color: rgb(51, 54, 57);
123+
}
113124
}
114125
115126
&.jw-alert-default {
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<preview>自定义描述文案</preview>
2+
<template>
3+
<jw-alert
4+
title="Success 类型"
5+
type="success"
6+
show-icon
7+
center
8+
description="这是一段描述"
9+
/>
10+
</template>
11+
<script setup lang="ts">
12+
import { IosAirplane } from "@vicons/ionicons4";
13+
</script>

src/views/doc/alert/index.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<Preview :component="AlertPreview1" />
77
<Preview :component="AlertPreview2" />
88
<Preview :component="AlertPreview3" />
9+
<Preview :component="AlertPreview4" />
910
</div>
1011
</div>
1112
</template>
@@ -15,6 +16,7 @@ import Preview from "@/components/Preview.vue";
1516
import AlertPreview1 from "./AlertPreview1.preview.vue";
1617
import AlertPreview2 from "./AlertPreview2.preview.vue";
1718
import AlertPreview3 from "./AlertPreview3.preview.vue";
19+
import AlertPreview4 from "./AlertPreview4.preview.vue";
1820
</script>
1921

2022
<style lang="scss">

0 commit comments

Comments
 (0)