From 486109b899a7d278ee9f0e8ac066bbed83403988 Mon Sep 17 00:00:00 2001 From: BTMuli Date: Sat, 17 Jun 2023 21:56:01 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20=E5=AE=8C=E6=88=90=E9=80=89?= =?UTF-8?q?=E4=B8=AD=E6=A0=87=E8=AE=B0&=E6=8F=8F=E8=BF=B0=E8=A7=A3?= =?UTF-8?q?=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tuc-detail-desc-constellation.vue | 16 +++++++- .../userCharacter/tuc-detail-desc.vue | 4 +- .../userCharacter/tuc-detail-overlay.vue | 38 ++++++++++++++----- 3 files changed, 46 insertions(+), 12 deletions(-) diff --git a/src/components/userCharacter/tuc-detail-desc-constellation.vue b/src/components/userCharacter/tuc-detail-desc-constellation.vue index 33601368..21d6f4c0 100644 --- a/src/components/userCharacter/tuc-detail-desc-constellation.vue +++ b/src/components/userCharacter/tuc-detail-desc-constellation.vue @@ -18,7 +18,7 @@ @@ -32,6 +32,20 @@ interface TucDetailDescConstellationProps { } const props = defineProps(); + +// 解析描述 +function parseDesc (desc: string): string { + const reg = /(.*?)<\/color>/g; + let match = reg.exec(desc); + while (match) { + const color = match[1]; + const text = match[2]; + desc = desc.replace(match[0], `${text}`); + match = reg.exec(desc); + } + desc = desc.replace(/\\n/g, "
"); + return desc; +}