From 2fd57d1fe8b626446bf34c12aa0f6a5a36f16220 Mon Sep 17 00:00:00 2001 From: liufangjia Date: Wed, 27 Nov 2024 16:43:31 +0800 Subject: [PATCH] wip: 代码提交 --- src/views/basic/askTestQuestion/components/analysisDialog.vue | 15 +++++++++++++++ src/views/basic/askTestQuestion/wrongQuestion.vue | 2 ++ 2 files changed, 17 insertions(+), 0 deletions(-) diff --git a/src/views/basic/askTestQuestion/components/analysisDialog.vue b/src/views/basic/askTestQuestion/components/analysisDialog.vue index 27198d2..62e13b9 100644 --- a/src/views/basic/askTestQuestion/components/analysisDialog.vue +++ b/src/views/basic/askTestQuestion/components/analysisDialog.vue @@ -69,6 +69,21 @@ export default { firstP.innerHTML = a; } }, + processString(input) { + // 正则表达式:匹配最多三位数字 + const regex = /^(\d{1,3})/; + + // 测试字符串是否以数字开头 + const match = input.match(regex); + + if (match) { + // 如果匹配,去掉开头的数字并返回剩余部分 + return input.substring(match[0].length + 1).trim(); + } + + // 如果没有匹配,直接返回原字符串 + return input; + }, }, }; diff --git a/src/views/basic/askTestQuestion/wrongQuestion.vue b/src/views/basic/askTestQuestion/wrongQuestion.vue index a0fb59f..45d4124 100644 --- a/src/views/basic/askTestQuestion/wrongQuestion.vue +++ b/src/views/basic/askTestQuestion/wrongQuestion.vue @@ -759,6 +759,8 @@ export default { border-radius: 5px; margin: 0 8px; cursor: pointer; + white-space: nowrap; + width: fit-content; } .Selected { background: rgba(223, 229, 253, 1); -- libgit2 0.21.4