javascript
<json-viewer :value="props.row.param_detail.query" :expand-depth="10" copyable>
</json-viewer>
官方文档中,说明,只要在json-viewer中加入 copyable属性,即可实现copy功能,如下图:
注意:这里我的页面右上角并没有出现copy按钮
最后通过官网的issue得出,这是个bug,我的版本是vue-json-viewer": "^2.2.22
解决方案:
javascript
<json-viewer :value="props.row.param_detail.query" :expand-depth="10" copyable>
<template v-slot:copy>
copy
</template>
</json-viewer>
在json-viewer中通过v-slot后,页面正常可以复制了,如下图

最后突出issue的解决方案:
地址:copyable 不生效是为什么 ·问题 #82 ·chenfengjw163/vue-json-viewer ·GitHub上
