diff --git a/web/src/views/database/ServerList.vue b/web/src/views/database/ServerList.vue index 9598c29e..b4963a43 100644 --- a/web/src/views/database/ServerList.vue +++ b/web/src/views/database/ServerList.vue @@ -52,7 +52,7 @@ const columns: any = [ { title: '密码', key: 'password', - width: 150, + width: 250, render(row: any) { return h(NInputGroup, null, { default: () => [ @@ -62,7 +62,19 @@ const columns: any = [ showPasswordOn: 'click', readonly: true, placeholder: '无' - }) + }), + h( + NButton, + { + type: 'primary', + ghost: true, + onClick: () => { + navigator.clipboard.writeText(row.password) + window.$message.success('复制成功') + } + }, + { default: () => '复制' } + ) ] }) } @@ -242,7 +254,7 @@ onUnmounted(() => { [ @@ -56,7 +56,19 @@ const columns: any = [ showPasswordOn: 'click', readonly: true, placeholder: '未保存' - }) + }), + h( + NButton, + { + type: 'primary', + ghost: true, + onClick: () => { + navigator.clipboard.writeText(row.password) + window.$message.success('复制成功') + } + }, + { default: () => '复制' } + ) ] }) } @@ -222,7 +234,7 @@ onUnmounted(() => {