TipsBox.vue
777 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<template>
<div class="tips-box-container">
<i class="el-icon-warning"></i>
<div class="tips-content">
<div v-for="(tip, index) in tips" :key="index" class="tip-item">
<span class="tip-text">{{ tip }}</span>
</div>
</div>
</div>
</template>
<script>
export default {
name: "TipsBox",
props: {
tips: {
type: Array,
default: () => [],
},
},
};
</script>
<style lang="scss" scoped>
.tips-box-container {
background: #fff3e8;
padding: 8px 20px;
display: flex;
align-items: flex-start; /* 顶部对齐 */
.el-icon-warning {
color: #ff8d1a;
margin: 2px 6px 0 0;
}
.tips-content {
.tip-item {
margin: 0;
font-size: 13px;
color: #ff8d1a;
.tip-text {
flex: 1; /* 让文字部分占据剩余空间 */
}
}
}
}
</style>