42 lines
892 B
Plaintext
42 lines
892 B
Plaintext
<template>
|
|
<view class="msg--text">
|
|
<text class="im--text" :class="guest ? 'right': 'left'">{{ msg.content }}</text>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
name: 'showText',
|
|
props: {
|
|
msg: {
|
|
type: Object,
|
|
default: {}
|
|
},
|
|
guest: {
|
|
type: Boolean,
|
|
default: true
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped lang="scss">
|
|
.im--text {
|
|
max-width: 400rpx;
|
|
padding: 20rpx;
|
|
font-size: 28rpx;
|
|
line-height: 40rpx;
|
|
|
|
&.left {
|
|
border-radius: 0 20rpx 20rpx 20rpx;
|
|
background: white;
|
|
}
|
|
|
|
&.right {
|
|
border-radius: 20rpx 0 20rpx 20rpx;
|
|
background: $main-color;
|
|
color: white;
|
|
}
|
|
}
|
|
</style>
|