mirror of
https://github.com/cool-team-official/cool-admin-vue.git
synced 2025-12-13 14:12:50 +00:00
优化
This commit is contained in:
parent
4e5ae1ea2f
commit
d8d360b334
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@cool-vue/crud",
|
||||
"version": "7.0.1-beta10",
|
||||
"version": "7.0.1-beta11",
|
||||
"private": false,
|
||||
"main": "./dist/index.umd.min.js",
|
||||
"typings": "types/index.d.ts",
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
:height="600"
|
||||
preview
|
||||
v-bind="props.props"
|
||||
v-model="text"
|
||||
v-model="content"
|
||||
/>
|
||||
|
||||
<template #footer>
|
||||
@ -52,8 +52,8 @@ const { copy } = useClipboard();
|
||||
// 是否可见
|
||||
const visible = ref(false);
|
||||
|
||||
// 文本
|
||||
const text = ref("");
|
||||
// 内容
|
||||
const content = ref("");
|
||||
|
||||
async function open(data?: string) {
|
||||
if (!data) {
|
||||
@ -61,11 +61,11 @@ async function open(data?: string) {
|
||||
}
|
||||
|
||||
if (isString(data)) {
|
||||
text.value = data;
|
||||
content.value = data;
|
||||
}
|
||||
|
||||
if (isObject(data)) {
|
||||
text.value = JSON.stringify(data, null, 4);
|
||||
content.value = JSON.stringify(data, null, 4);
|
||||
}
|
||||
|
||||
visible.value = true;
|
||||
@ -82,7 +82,7 @@ function close() {
|
||||
}
|
||||
|
||||
function toCopy() {
|
||||
copy(text.value);
|
||||
copy(content.value);
|
||||
ElMessage.success("复制成功");
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user