File tree Expand file tree Collapse file tree
www/.vitepress/theme/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11<script setup lang="ts">
2- import { computed , ref } from ' vue'
2+ import { computed , onBeforeUnmount , ref } from ' vue'
33
44const 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 >
Original file line number Diff line number Diff 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 >
You can’t perform that action at this time.
0 commit comments