mirror of
https://github.com/kuaifan/dootask.git
synced 2026-11-07 10:20:33 +00:00
- 移除「复制原文 / 复制选择 / 复制全部」;「选择复制」打开复制页,可自由选字、底部按钮复制全部,Markdown 消息支持预览 / 原文切换 - 复制页标题与其他会话抽屉一致(居中标题),Markdown 预览沿用消息气泡的深色模式处理 - 移动端打开菜单后不再允许长按选字,移除 selectionchange 监听与 operateEnter - 桌面端保留在消息中选字,直接用键盘复制 - 更新语言包与 ai-kb 移动端手势说明
56 lines
1.5 KiB
Vue
56 lines
1.5 KiB
Vue
<template>
|
|
<div class="dialog-text-select">
|
|
<div class="text-select-title" :class="{bordered: !source}">{{ $L('选择复制') }}</div>
|
|
<ul v-if="source" class="text-select-tabs">
|
|
<li :class="{active: tab === 'preview'}" @click="tab = 'preview'">{{ $L('预览') }}</li>
|
|
<li :class="{active: tab === 'source'}" @click="tab = 'source'">{{ $L('原文') }}</li>
|
|
</ul>
|
|
<div class="text-select-content user-select-auto">
|
|
<DialogMarkdown v-if="source && tab === 'preview'" class="no-dark-content" :text="source"/>
|
|
<pre v-else>{{ currentText }}</pre>
|
|
</div>
|
|
<div class="text-select-button">
|
|
<Button type="primary" size="large" icon="md-copy" long @click="onCopyAll">{{ $L('复制全部') }}</Button>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import DialogMarkdown from "./DialogMarkdown.vue";
|
|
|
|
export default {
|
|
name: "DialogTextSelect",
|
|
components: {DialogMarkdown},
|
|
props: {
|
|
// 消息显示的文本
|
|
text: {
|
|
type: String,
|
|
default: ''
|
|
},
|
|
// Markdown 原文(仅 Markdown 消息)
|
|
source: {
|
|
type: String,
|
|
default: ''
|
|
},
|
|
},
|
|
|
|
data() {
|
|
return {
|
|
tab: 'preview',
|
|
}
|
|
},
|
|
|
|
computed: {
|
|
currentText() {
|
|
return this.source && this.tab === 'source' ? this.source : this.text
|
|
}
|
|
},
|
|
|
|
methods: {
|
|
onCopyAll() {
|
|
this.copyText(this.currentText)
|
|
}
|
|
}
|
|
}
|
|
</script>
|