From f6065f467281c8f1094cb57064da39018d9138b3 Mon Sep 17 00:00:00 2001 From: AceDataCloud Date: Tue, 24 Jan 2023 00:01:08 +0800 Subject: [PATCH] add copy to clipboard --- package.json | 1 + src/components/common/CopyToClipboard.vue | 41 +++++++++++++++++++++++ src/pages/console/application/List.vue | 6 ++-- yarn.lock | 12 +++++++ 4 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 src/components/common/CopyToClipboard.vue diff --git a/package.json b/package.json index acc26c9f..3f0cb925 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "@types/uuid": "^8.3.4", "axios": "^0.21.1", "codemirror": "^6.0.1", + "copy-to-clipboard": "^3.3.3", "dayjs": "^1.10.7", "element-plus": "^1.3.0-beta.10", "github-markdown-css": "^5.1.0", diff --git a/src/components/common/CopyToClipboard.vue b/src/components/common/CopyToClipboard.vue new file mode 100644 index 00000000..8621ddb1 --- /dev/null +++ b/src/components/common/CopyToClipboard.vue @@ -0,0 +1,41 @@ + + + diff --git a/src/pages/console/application/List.vue b/src/pages/console/application/List.vue index 0a677713..5edd733a 100644 --- a/src/pages/console/application/List.vue +++ b/src/pages/console/application/List.vue @@ -32,7 +32,7 @@ @@ -67,6 +67,7 @@ import { defineComponent } from 'vue'; import { applicationOperator, IApplication, IApplicationListResponse, IService } from '@/operators'; import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'; import Pagination from '@/components/common/Pagination.vue'; +import CopyToClipboard from '@/components/common/CopyToClipboard.vue'; interface IData { applications: IApplication[]; @@ -80,7 +81,8 @@ export default defineComponent({ name: 'ApplicationList', components: { FontAwesomeIcon, - Pagination + Pagination, + CopyToClipboard }, data(): IData { return { diff --git a/yarn.lock b/yarn.lock index 6c1daf00..bfc887d1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1160,6 +1160,13 @@ constantinople@^4.0.1: "@babel/parser" "^7.6.0" "@babel/types" "^7.6.1" +copy-to-clipboard@^3.3.3: + version "3.3.3" + resolved "https://registry.yarnpkg.com/copy-to-clipboard/-/copy-to-clipboard-3.3.3.tgz#55ac43a1db8ae639a4bd99511c148cdd1b83a1b0" + integrity sha512-2KV8NhB5JqC3ky0r9PMCAZKbUHSwtEo4CwCs0KXgruG43gX5PMqDEBbVU4OUzw2MuAWUfsuFmWvEKG5QRfSnJA== + dependencies: + toggle-selection "^1.0.6" + cosmiconfig@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-7.0.1.tgz#714d756522cace867867ccb4474c5d01bbae5d6d" @@ -3268,6 +3275,11 @@ to-regex-range@^5.0.1: dependencies: is-number "^7.0.0" +toggle-selection@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/toggle-selection/-/toggle-selection-1.0.6.tgz#6e45b1263f2017fa0acc7d89d78b15b8bf77da32" + integrity sha512-BiZS+C1OS8g/q2RRbJmy59xpyghNBqrr6k5L/uKBGRsTfxmu3ffiRnd8mlGPUVayg8pvfi5urfnu8TU7DVOkLQ== + token-stream@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/token-stream/-/token-stream-1.0.0.tgz#cc200eab2613f4166d27ff9afc7ca56d49df6eb4"