2021-09-23 09:35:06 +00:00
|
|
|
<template>
|
|
|
|
<div id="app">
|
2023-02-15 05:33:09 +00:00
|
|
|
<VFormDesigner ref="vfDesignerRef" :designer-config="designerConfig" :global-dsv="globalDsv">
|
2022-03-09 03:29:43 +00:00
|
|
|
<template #customToolButtons>
|
|
|
|
<el-button type="text" @click="printFormJson">测试按钮</el-button>
|
|
|
|
</template>
|
|
|
|
</VFormDesigner>
|
2021-09-23 09:35:06 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import VFormDesigner from './components/form-designer/index.vue'
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'App',
|
|
|
|
components: {
|
|
|
|
VFormDesigner,
|
2022-02-21 06:33:04 +00:00
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
designerConfig: {
|
2022-02-23 04:16:09 +00:00
|
|
|
resetFormJson: false,
|
2022-03-09 03:29:43 +00:00
|
|
|
toolbarMaxWidth: 490,
|
2023-02-15 05:33:09 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
//全局数据源变量
|
|
|
|
globalDsv: {
|
|
|
|
testApiHost: 'http://www.test.com/api',
|
|
|
|
testPort: 8080,
|
|
|
|
},
|
2022-02-21 06:33:04 +00:00
|
|
|
}
|
2022-03-09 03:29:43 +00:00
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
printFormJson() {
|
|
|
|
console.log( this.$refs.vfDesignerRef.getFormJson() )
|
|
|
|
}
|
2021-09-23 09:35:06 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
#app {
|
|
|
|
height: 100%;
|
|
|
|
}
|
|
|
|
</style>
|