数据格式化编辑器: 方便你实现在线的数据格式化编辑与显示的工具。支持的数据格式包括:JSON、HTML、XML
源码工程地址:vue_data_editor
由于源码未创建npm包,所以请手动下载工具源码使用,谢谢!~
import VueDataEditor from './vue_data_editor'
export default {
name: 'ace_index',
data: () => ({
json_value: "{\"q\":\"百度\",\"p\":false,\"g\":[{\"type\":\"sug\",\"sa\":\"s_1\",\"q\":\"百度翻译\"},{\"type\":\"sug\",\"sa\":\"s_2\",\"q\":\"百度地图\"},{\"type\":\"sug\",\"sa\":\"s_3\",\"q\":\"百度网盘\"},{\"type\":\"sug\",\"sa\":\"s_4\",\"q\":\"百度识图\"},{\"type\":\"sug\",\"sa\":\"s_5\",\"q\":\"百度新闻\"},{\"type\":\"sug\",\"sa\":\"s_6\",\"q\":\"百度视频\"},{\"type\":\"sug\",\"sa\":\"s_7\",\"q\":\"百度搜题\"},{\"type\":\"sug\",\"sa\":\"s_8\",\"q\":\"百度一下\"},{\"type\":\"sug\",\"sa\":\"s_9\",\"q\":\"百度手机卫士隐私保护专版\"},{\"type\":\"sug\",\"sa\":\"s_10\",\"q\":\"百度小说\"}],\"slid\":\"2268943525663350670\"}",
xml_value: " org.mybatis.generator mybatis-generator-maven-plugin 1.3.2 src/main/resources/generatorConfig.xml true true ",
html_value: " kb-vue-components ",
}),
render(h) {
return h('div', {
staticClass: 'q-pa-sm'
}, [
h('div', {
staticClass: 'text-left text-tertiary font-14 text-weight-bold'
}, [
'JSON数据格式显示效果:'
]),
h(VueDataEditor, {
on: {
input: (v) => {
this.json_value = v
}
},
props: {
value: this.json_value,
disable: false,
width: '100%',
height: '400px'
}
}),
h('div', {
staticClass: 'row no-wrap q-mt-md'
}, [
h('div', {
staticClass: 'q-pr-sm',
style: {
width: '50%'
}
}, [
h('div', {
staticClass: 'text-left text-tertiary font-14 text-weight-bold'
}, [
'XML数据格式显示效果:'
]),
h(VueDataEditor, {
props: {
value: this.xml_value,
disable: true,
height: '400px'
}
}),
]),
h('div', {
staticClass: 'q-pl-sm',
style: {
width: '50%'
}
}, [
h('div', {
staticClass: 'text-left text-tertiary font-14 text-weight-bold'
}, [
'HTML数据格式显示效果:'
]),
h(VueDataEditor, {
props: {
value: this.html_value,
disable: true,
height: '400px'
}
})
])
])
])
}
}
插件地址:brace