fit chat restart (#107)

This commit is contained in:
HCode authored and GitHub committed 2024-08-16 00:10:33 +08:00
1 parent 1477fa9879
commit 1acebc5651
7 files changed
+193 -9

No files matched your search

+4 -1
View File
@@ -1,5 +1,8 @@
<template>
<font-awesome-icon v-if="!copied" icon="fa-regular fa-copy" class="icon-copy" @click="onCopy" />
<el-tooltip v-if="!copied" effect="dark" :content="$t('common.button.copy')" placement="top-start">
<font-awesome-icon icon="fa-regular fa-copy" class="icon-copy" @click="onCopy"
/></el-tooltip>
<el-tooltip v-else :visible="copied" effect="dark" :content="$t('common.message.copied')" placement="top-start">
<font-awesome-icon icon="fa-solid fa-check" class="icon-check" />
</el-tooltip>
@@ -0,0 +1,46 @@
<template>
<el-tooltip effect="dark" :content="$t('common.button.restart')" placement="top-start">
<font-awesome-icon icon="fa-solid fa-sync" class="icon-sync" @click="onRestart" />
</el-tooltip>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
import { ElTooltip } from 'element-plus';
export default defineComponent({
name: 'CopyToClipboard',
components: {
FontAwesomeIcon,
ElTooltip
},
props: {
messages: {
type: Array,
required: false,
default: () => []
}
},
emits: ['restart'],
data() {
return {
copied: false
};
},
methods: {
onRestart() {
this.$emit('restart');
}
}
});
</script>
<style lang="scss" scoped>
.icon-check,
.icon-copy {
margin-left: 5px;
cursor: pointer;
color: inherit;
}
</style>