From e28d1fc6231c33a514c4d15819d8aa80d5a27774 Mon Sep 17 00:00:00 2001 From: zouzhibing Date: Sat, 7 May 2022 14:28:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=8F=B3=E9=94=AE=E8=8F=9C?= =?UTF-8?q?=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/u-rightClickMenu/index.vue | 112 ++++++++++++++++++++++ src/router/modules/other.ts | 7 +- src/utils/clipboard.ts | 4 +- src/views/other/qrcode.vue | 4 +- src/views/other/right-menu.vue | 58 +++++++++++ 5 files changed, 180 insertions(+), 5 deletions(-) create mode 100644 src/components/u-rightClickMenu/index.vue create mode 100644 src/views/other/right-menu.vue diff --git a/src/components/u-rightClickMenu/index.vue b/src/components/u-rightClickMenu/index.vue new file mode 100644 index 0000000..c2fd794 --- /dev/null +++ b/src/components/u-rightClickMenu/index.vue @@ -0,0 +1,112 @@ + + + diff --git a/src/router/modules/other.ts b/src/router/modules/other.ts index 3e3310d..6e3b2b9 100644 --- a/src/router/modules/other.ts +++ b/src/router/modules/other.ts @@ -42,7 +42,12 @@ const othersRouter = { name: 'qrcode', meta: { title: '生成二维码', noCache: true } }, - + { + path: 'right-menu', + component: () => import('@/views/other/right-menu.vue'), + name: 'qrcode', + meta: { title: '右键菜单', noCache: true } + }, ] } diff --git a/src/utils/clipboard.ts b/src/utils/clipboard.ts index 87a92e9..5343e9e 100644 --- a/src/utils/clipboard.ts +++ b/src/utils/clipboard.ts @@ -18,7 +18,7 @@ function clipboardError() { } export default function handleClipboard(text, event) { - const clipboard = new Clipboard(event.target, { + const clipboard:any = new Clipboard(event.target, { text: () => text }) clipboard.on('success', () => { @@ -30,4 +30,4 @@ export default function handleClipboard(text, event) { clipboard.destroy() }) clipboard.onClick(event) -} \ No newline at end of file +} diff --git a/src/views/other/qrcode.vue b/src/views/other/qrcode.vue index 6b7b11f..e24f4a2 100644 --- a/src/views/other/qrcode.vue +++ b/src/views/other/qrcode.vue @@ -14,7 +14,7 @@ \ No newline at end of file + diff --git a/src/views/other/right-menu.vue b/src/views/other/right-menu.vue new file mode 100644 index 0000000..a1a1390 --- /dev/null +++ b/src/views/other/right-menu.vue @@ -0,0 +1,58 @@ + + + + +