parent
f392f98658
commit
3402f6acee
6 changed files with 2830 additions and 306 deletions
File diff suppressed because it is too large
Load Diff
@ -1,11 +1,45 @@ |
|||||||
<script setup> |
<script setup> |
||||||
|
import {ref, toRef} from "vue"; |
||||||
|
import JsonEditorVue from 'json-editor-vue3' |
||||||
|
// import {TabsPaneContext} from "element-plus"; |
||||||
|
|
||||||
|
const props = defineProps( |
||||||
|
{ |
||||||
|
json_data: { |
||||||
|
type: Object, |
||||||
|
default: () => { |
||||||
|
return {} |
||||||
|
} |
||||||
|
}, |
||||||
|
tabs: { |
||||||
|
type: Array, |
||||||
|
default: () => { |
||||||
|
return [] |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
) |
||||||
|
const json_data = toRef(props.json_data) |
||||||
|
const tabs = props.tabs |
||||||
|
|
||||||
|
const activeName = ref(``) |
||||||
|
const handleClick = (tab, event) => { |
||||||
|
console.log(tab, event) |
||||||
|
} |
||||||
|
|
||||||
</script> |
</script> |
||||||
|
|
||||||
<template> |
<template> |
||||||
|
<el-tabs v-model="activeName" class="api_tabs" @tab-click="handleClick"> |
||||||
|
<el-tab-pane v-for="(tab,index) in tabs" :label="tab.label" :name="tab.name"> |
||||||
|
<JsonEditorVue class="editor" v-model="json_data" language="zh-CN"/> |
||||||
|
</el-tab-pane> |
||||||
|
</el-tabs> |
||||||
|
<!-- <JsonEditorVue class="editor" v-model="json_data" language="zh-CN"/>--> |
||||||
</template> |
</template> |
||||||
|
|
||||||
<style scoped> |
<style scoped> |
||||||
|
.editor { |
||||||
|
width: 75%; |
||||||
|
} |
||||||
</style> |
</style> |
||||||
|
Loading…
Reference in new issue