diff --git a/packages/nc-gui-v2/components/smartsheet/ApiSnippet.vue b/packages/nc-gui-v2/components/smartsheet/ApiSnippet.vue index 6ead87ede1..199c768641 100644 --- a/packages/nc-gui-v2/components/smartsheet/ApiSnippet.vue +++ b/packages/nc-gui-v2/components/smartsheet/ApiSnippet.vue @@ -64,7 +64,7 @@ const langs = [ }, ] -const selectedClient = $ref(langs[0].clients && langs[0].clients[0]) +let selectedClient = $ref(langs[0].clients && langs[0].clients[0]) const selectedLangName = $ref(langs[0].name) @@ -123,6 +123,11 @@ const onCopyToClipboard = () => { const afterVisibleChange = (visible: boolean) => { vModel = visible } + +watch($$(activeLang), (newLang) => { + selectedClient = newLang?.clients?.[0] +}) +