2
0
mirror of https://github.com/tenrok/vue-json-viewer.git synced 2026-06-23 20:40:38 +03:00

fix: copy issue

This commit is contained in:
风棋
2021-05-16 15:28:02 +08:00
parent 054b4089c7
commit 160b1d77ad
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -1,5 +1,5 @@
<template> <template>
<div :class="jvClass"> <div ref="viewer" :class="jvClass">
<div <div
v-if="copyable" v-if="copyable"
:class="`jv-tooltip ${copyText.align || 'right'}`" :class="`jv-tooltip ${copyText.align || 'right'}`"
@@ -131,6 +131,7 @@ export default {
} }
if (this.copyable) { if (this.copyable) {
const clipBoard = new Clipboard(this.$refs.clip, { const clipBoard = new Clipboard(this.$refs.clip, {
container: this.$refs.viewer,
text: () => { text: () => {
return JSON.stringify(this.value, null, 2) return JSON.stringify(this.value, null, 2)
} }
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "vue-json-viewer", "name": "vue-json-viewer",
"version": "2.2.18", "version": "2.2.19",
"description": "vuejs展示json的组件", "description": "vuejs展示json的组件",
"main": "vue-json-viewer.js", "main": "vue-json-viewer.js",
"files": [ "files": [