mirror of
https://github.com/vbenjs/gf-vben-admin.git
synced 2025-01-23 20:00:19 +08:00
parent
044e2e4e86
commit
83c1683bfd
@ -14,8 +14,8 @@
|
||||
</PageWrapper>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { defineComponent, ref } from 'vue';
|
||||
import { CodeEditor } from '/@/components/CodeEditor';
|
||||
import { defineComponent, ref, unref, h } from 'vue';
|
||||
import { CodeEditor, JsonPreview } from '/@/components/CodeEditor';
|
||||
import { PageWrapper } from '/@/components/Page';
|
||||
import { Radio, Space, Modal } from 'ant-design-vue';
|
||||
|
||||
@ -82,7 +82,14 @@
|
||||
}
|
||||
|
||||
function showData() {
|
||||
Modal.info({ title: '编辑器当前值', content: value.value });
|
||||
if (unref(modeValue) === 'application/json') {
|
||||
Modal.info({
|
||||
title: '编辑器当前值',
|
||||
content: h(JsonPreview, { data: JSON.parse(value.value) }),
|
||||
});
|
||||
} else {
|
||||
Modal.info({ title: '编辑器当前值', content: value.value });
|
||||
}
|
||||
}
|
||||
|
||||
return { value, modeValue, handleModeChange, showData };
|
||||
|
Loading…
Reference in New Issue
Block a user