Skip to content

Commit 3a04fe5

Browse files
committed
fix(www): 处理官网组件评审反馈
1 parent 6b27d6b commit 3a04fe5

2 files changed

Lines changed: 14 additions & 5 deletions

File tree

www/.vitepress/theme/components/CodePanel.vue

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup lang="ts">
2-
import { computed, ref } from 'vue'
2+
import { computed, onBeforeUnmount, ref } from 'vue'
33
44
const props = withDefaults(
55
defineProps<{
@@ -62,8 +62,13 @@ function fallbackCopy(text: string) {
6262
textarea.style.opacity = '0'
6363
document.body.appendChild(textarea)
6464
textarea.select()
65-
document.execCommand('copy')
66-
document.body.removeChild(textarea)
65+
try {
66+
if (!document.execCommand('copy')) {
67+
throw new Error('execCommand copy failed')
68+
}
69+
} finally {
70+
document.body.removeChild(textarea)
71+
}
6772
}
6873
6974
// scheduleReset 用于在提示短暂展示后恢复默认文案。
@@ -81,6 +86,10 @@ function clearResetTimer() {
8186
resetTimer = undefined
8287
}
8388
}
89+
90+
onBeforeUnmount(() => {
91+
clearResetTimer()
92+
})
8493
</script>
8594

8695
<template>

www/.vitepress/theme/components/QuickStartCards.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ $env:QINIU_API_KEY = "your_key_here"`
4747
<CodePanel language="powershell" label="PowerShell" :code="envWindows" />
4848
<div class="quickstart-links">
4949
<p>Workspace isolation: <code>--workdir</code></p>
50-
<p>Gateway mode: <code>--runtime-mode gateway</code></p>
50+
<p>Gateway command: <code>neocode gateway</code></p>
5151
<p><a href="/neo-code/guide/quick-start">Chinese quick start</a></p>
5252
<p><a href="/neo-code/en/docs/">English docs index</a></p>
5353
</div>
@@ -82,7 +82,7 @@ $env:QINIU_API_KEY = "your_key_here"`
8282
<CodePanel language="powershell" label="PowerShell" :code="envWindows" />
8383
<div class="quickstart-links">
8484
<p>工作区隔离:<code>--workdir</code></p>
85-
<p>网关模式:<code>--runtime-mode gateway</code></p>
85+
<p>网关命令:<code>neocode gateway</code></p>
8686
<p><a href="/neo-code/guide/quick-start">继续看首次上手</a></p>
8787
<p><a href="/neo-code/guide/gateway">查看 Gateway 用法</a></p>
8888
</div>

0 commit comments

Comments
 (0)