update index
This commit is contained in:
1 parent
71dec1cb67
commit
10f82c9ca2
3 files changed
+31
-40
No files matched your search
@@ -1,9 +1,12 @@
|
||||
<template>
|
||||
<div :class="'message ' + message.role">
|
||||
<div :class="'message ' + message.role" :role="message.role">
|
||||
<div class="content">
|
||||
<markdown-renderer :content="message?.content" />
|
||||
<answering-mark v-if="message.state === messageState.PENDING" />
|
||||
</div>
|
||||
<div class="operations">
|
||||
<copy-to-clipboard :content="message.content" class="btn-copy" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -17,7 +20,7 @@ import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
||||
import copy from 'copy-to-clipboard';
|
||||
import MarkdownRenderer from '@/components/common/MarkdownRenderer.vue';
|
||||
import { IChatMessage, IChatMessageState } from '@/operators';
|
||||
|
||||
import CopyToClipboard from '../common/CopyToClipboard.vue';
|
||||
interface IData {
|
||||
copied: boolean;
|
||||
messageState: typeof IChatMessageState;
|
||||
@@ -28,8 +31,9 @@ export default defineComponent({
|
||||
components: {
|
||||
// MessageContent,
|
||||
// ElImage,
|
||||
// ElButton,
|
||||
// FontAwesomeIcon
|
||||
ElButton,
|
||||
CopyToClipboard,
|
||||
// FontAwesomeIcon,
|
||||
AnsweringMark,
|
||||
MarkdownRenderer
|
||||
},
|
||||
@@ -52,15 +56,15 @@ export default defineComponent({
|
||||
// }
|
||||
},
|
||||
methods: {
|
||||
// onCopy() {
|
||||
// copy(this.content.value, {
|
||||
// debug: true
|
||||
// });
|
||||
// this.copied = true;
|
||||
// setTimeout(() => {
|
||||
// this.copied = false;
|
||||
// }, 3000);
|
||||
// },
|
||||
onCopy() {
|
||||
copy(this.message.content, {
|
||||
debug: true
|
||||
});
|
||||
this.copied = true;
|
||||
setTimeout(() => {
|
||||
this.copied = false;
|
||||
}, 3000);
|
||||
}
|
||||
// onStop() {
|
||||
// this.$emit('stop');
|
||||
// }
|
||||
@@ -72,6 +76,9 @@ export default defineComponent({
|
||||
.message {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
&[role='system'] {
|
||||
display: none;
|
||||
}
|
||||
&.assistant {
|
||||
align-items: start;
|
||||
.content {
|
||||
@@ -94,5 +101,13 @@ export default defineComponent({
|
||||
max-width: 800px;
|
||||
// background-color: aqua;
|
||||
}
|
||||
|
||||
.operations {
|
||||
display: block;
|
||||
.btn-copy {
|
||||
color: var(--el-text-color-regular);
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -47,5 +47,6 @@ export default defineComponent({
|
||||
.icon-copy {
|
||||
margin-left: 5px;
|
||||
cursor: pointer;
|
||||
color: inherit;
|
||||
}
|
||||
</style>
|
||||
@@ -1,12 +1,5 @@
|
||||
<template>
|
||||
<div class="page">
|
||||
<div class="left">3</div>
|
||||
<div class="main">
|
||||
<model-selector v-model="model" class="model-selector" />
|
||||
<introduction />
|
||||
<input-box v-model="question" class="input-box" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="page"></div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
@@ -19,11 +12,7 @@ import InputBox from '@/components/chat/InputBox.vue';
|
||||
import ModelSelector from '@/components/chat/ModelSelector.vue';
|
||||
export default defineComponent({
|
||||
name: 'ChatIndex',
|
||||
components: {
|
||||
Introduction,
|
||||
InputBox,
|
||||
ModelSelector
|
||||
},
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
model: 'chatgpt',
|
||||
@@ -49,20 +38,6 @@ export default defineComponent({
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
.input-box {
|
||||
display: block;
|
||||
position: absolute;
|
||||
bottom: 10px;
|
||||
right: 10px;
|
||||
left: 10px;
|
||||
}
|
||||
.model-selector {
|
||||
position: absolute;
|
||||
top: 30px;
|
||||
left: 50%;
|
||||
transform: translate(-50%, 0);
|
||||
z-index: 100;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user