From 175e4c07f08763b4506f9aea44ffdf370f0ba6c6 Mon Sep 17 00:00:00 2001 From: dxhuii Date: Wed, 24 Apr 2024 15:10:40 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=AE=80=E7=B9=81?= =?UTF-8?q?=E8=BD=AC=E6=8D=A2=E6=B8=85=E7=A9=BA=E7=9A=84=E6=97=B6=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E6=B8=85=E9=99=A4=E6=97=B6=E9=97=B4=E5=92=8C=E5=AD=97?= =?UTF-8?q?=E6=95=B0=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/simple2traditional.vue | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pages/simple2traditional.vue b/pages/simple2traditional.vue index ca10ae0..ac63d0b 100644 --- a/pages/simple2traditional.vue +++ b/pages/simple2traditional.vue @@ -13,8 +13,8 @@ useHead({ const type = ref('s2t') const isEnhance = ref(false) -const meta = ref('共 0 字,耗时 0ms') const output = ref('') +const time = ref(0) function toggleType() { type.value = type.value === 's2t' ? 't2s' : 's2t' @@ -29,11 +29,10 @@ function convert() { const text = input.value const begin = performance.now() const result = type.value === 's2t' ? toTraditional(text, isEnhance.value) : toSimplified(text, isEnhance.value) - const time = performance.now() - begin output.value = result.replace(/\n/g, '
') - meta.value = `共 ${text.length} 字,耗时 ${time.toFixed(2)}ms` + time.value = Number.parseFloat((performance.now() - begin).toFixed(2)) } async function paste() { @@ -70,7 +69,7 @@ async function paste() { - @@ -79,7 +78,7 @@ async function paste() {

- {{ meta }} + 共 {{ input?.length || 0 }} 字,耗时 {{ time }}ms