feat: vue-mobile => 优化聊天记录拍版样式

This commit is contained in:
RockYang
2023-06-25 18:21:38 +08:00
parent f01fdd0070
commit 5f3a5871f1
8 changed files with 284 additions and 178 deletions

View File

@@ -0,0 +1,74 @@
<template>
<div class="message-reply">
<div class="chat-item">
<div class="content" v-html="content"></div>
<div class="triangle"></div>
</div>
<div class="chat-icon">
<img :src="icon" alt="User"/>
</div>
</div>
</template>
<script>
import {defineComponent} from "vue"
export default defineComponent({
name: 'ChatPrompt',
props: {
content: {
type: String,
default: '',
},
icon: {
type: String,
default: 'images/user-icon.png',
}
},
data() {
return {}
},
})
</script>
<style lang="stylus">
.message-reply {
justify-content: flex-end;
.chat-icon {
margin-left 5px;
img {
border-radius 5px;
}
}
.chat-item {
position: relative;
padding: 0 5px 0 0;
overflow: hidden;
.triangle {
width: 0;
height: 0;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
border-left: 5px solid #98E165;
position: absolute;
right: 0;
top: 10px;
}
.content {
word-break break-word;
padding: 6px 10px;
background-color: #98E165;
color var(--content-color);
font-size: var(--content-font-size);
border-radius: 5px;
line-height 1.5
}
}
}
</style>