实现聊天光标闪烁,实现聊天会话上下文

This commit is contained in:
RockYang
2023-03-19 00:31:35 +08:00
parent 59782e9e57
commit e2c3f50c8a
8 changed files with 146 additions and 92 deletions

View File

@@ -6,7 +6,10 @@
<div class="chat-item">
<div class="triangle"></div>
<div class="content">{{ content }}</div>
<div class="content">
<span v-html="content"></span>
<span class="cursor" v-show="cursor"></span>
</div>
</div>
</div>
</template>
@@ -24,6 +27,10 @@ export default defineComponent({
icon: {
type: String,
default: 'images/gpt-icon.png',
},
cursor: {
type: Boolean,
default: true
}
},
data() {
@@ -68,6 +75,21 @@ export default defineComponent({
background-color: #fff;
font-size: var(--content-font-size);
border-radius: 5px;
.cursor {
height 24px;
border-left 1px solid black;
animation: cursorImg 1s infinite steps(1, start);
@keyframes cursorImg {
0%, 100% {
opacity: 0;
}
50% {
opacity: 1;
}
}
}
}
}
}