From d45df3cda5807402907e488309ec80207449ac95 Mon Sep 17 00:00:00 2001 From: sanbuphy Date: Mon, 23 Feb 2026 12:34:00 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E7=A6=81=E7=94=A8=20Prettier=20?= =?UTF-8?q?=E5=AF=B9=20Vue=20=E6=96=87=E4=BB=B6=E7=9A=84=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E5=8C=96=EF=BC=8C=E4=BF=AE=E5=A4=8D=E8=AF=AD=E6=B3=95=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 .prettierignore 中添加 **/*.vue,避免格式化 Vue 组件 - 保留 JS 文件的格式化功能 - 避免 Prettier 将多行 HTML 属性压缩成单行,保持代码可读性 - 修复 ABTestingDemo.vue 中的语法错误: - 第 467 行:computed 回调函数缺少括号 - 第 201 行:HTML 中的 < 符号需要转义为 < - 第 480-481 行:变量声明缺少 const 关键字 --- .prettierignore | 1 + .prettierrc | 12 +++++++++++- .../theme/components/appendix/data/ABTestingDemo.vue | 10 ++++------ 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/.prettierignore b/.prettierignore index de05607..6f79715 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1 +1,2 @@ **/*.md +**/*.vue diff --git a/.prettierrc b/.prettierrc index 49955e2..a93b0d6 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,5 +1,15 @@ { "semi": false, "singleQuote": true, - "trailingComma": "none" + "trailingComma": "none", + "overrides": [ + { + "files": "*.vue", + "options": { + "parser": "vue", + "htmlWhitespaceSensitivity": "ignore", + "vueIndentScriptAndStyle": false + } + } + ] } diff --git a/docs/.vitepress/theme/components/appendix/data/ABTestingDemo.vue b/docs/.vitepress/theme/components/appendix/data/ABTestingDemo.vue index fb72f84..2fd1617 100644 --- a/docs/.vitepress/theme/components/appendix/data/ABTestingDemo.vue +++ b/docs/.vitepress/theme/components/appendix/data/ABTestingDemo.vue @@ -197,9 +197,7 @@
💡 - P值 < 0.05 表示结果统计显著,说明差异不太可能是随机产生的 + P值 < 0.05 表示结果统计显著,说明差异不太可能是随机产生的
@@ -464,7 +462,7 @@ const targetRate = computed( ) const absoluteDifference = computed( - => (targetRate.value - baselineRate.value).toFixed(2) + () => (targetRate.value - baselineRate.value).toFixed(2) ) const estimatedDays = computed(() => { @@ -477,8 +475,8 @@ const estimatedDays = computed(() => { function calculateSampleSize() { const p1 = baselineRate.value / 100 const p2 = targetRate.value / 100 - constZa = 1.96 // alpha = 0.05对应的z值 - constZb = 0.84 // power = 0.8对应的z值 + const constZa = 1.96 // alpha = 0.05对应的z值 + const constZb = 0.84 // power = 0.8对应的z值 // 合并标准差 const pBar = (p1 + p2) / 2