mateclaw/mateclaw-ui/src/components/chat/TypingCursor.vue
matevip 579d60125b Initial commit: MateClaw — Java + Vue 3 AI Assistant System
Full-stack AI assistant built on Spring AI Alibaba.
Features: ReAct Agent, Plan-and-Execute, MCP Protocol, Multi-Model, Multi-Channel.

Apache-2.0 License
2026-04-04 19:03:49 +08:00

48 lines
765 B
Vue

<template>
<span class="typing-cursor" :class="{ blinking: !typing }"></span>
</template>
<script setup lang="ts">
interface Props {
/** 是否正在打字 */
typing?: boolean
/** 光标颜色 */
color?: string
}
withDefaults(defineProps<Props>(), {
typing: false,
color: 'currentColor',
})
</script>
<style scoped>
.typing-cursor {
display: inline-block;
width: 2px;
height: 1.2em;
background-color: v-bind(color);
margin-left: 2px;
vertical-align: middle;
animation: blink 1s step-end infinite;
}
.typing-cursor.blinking {
animation: blink 1s step-end infinite;
}
.typing-cursor:not(.blinking) {
animation: none;
opacity: 1;
}
@keyframes blink {
0%, 50% {
opacity: 1;
}
51%, 100% {
opacity: 0;
}
}
</style>