Fix the issue #121

Former-commit-id: 54cd47159d1730376ed79d08d4e11749305fdfca
This commit is contained in:
Physton
2023-06-12 10:19:10 +08:00
parent 7a3c33d0d7
commit 97541c90ab
5 changed files with 9 additions and 5 deletions

View File

@@ -1 +1 @@
ac9173f92d0d9efb5ad096515c59f1b80e80c7c6
adbc0994e8389b296fd143527e38f7c0aaaf1777

View File

@@ -1 +1 @@
6608d3648d4ae007d02e8de65b1a21a8f6c7de7f
f2260bdbdce1f69fc050c59a014dffde4879fe87

View File

@@ -1 +1 @@
c07839494381a8b93f80adca0cabbfce8a7bc492
a0419acb5f80b8b9774051d49ab33a9ef9a776fa

View File

@@ -306,11 +306,14 @@ export default {
}
let indexes = []
tags.forEach(tag => {
let index = -1
if (tag === "\n") {
indexes.push(this._appendTag("\n", "\n", false, -1, 'wrap'))
index = this._appendTag("\n", "\n", false, -1, 'wrap')
} else {
indexes.push(this._appendTag(tag))
index = this._appendTag(tag)
console.log(tag, index)
}
if (index !== -1) indexes.push(index)
})
this.updatePrompt() // 先更新再翻译
if (this.autoTranslateToEnglish || this.autoTranslateToLocal) {

View File

@@ -114,6 +114,7 @@ export default {
return tag
},
_appendTag(value, localValue = '', disabled = false, index = -1, type = 'text') {
if (value === '') return -1
// 唯一数:当前时间戳+随机数
const id = Date.now() + (Math.random() * 1000000).toFixed(0)
let tag = {