<template>
|
<fc-designer ref="designer" :config="config" @save="handleSave" />
|
</template>
|
|
<script setup>
|
import { ref } from 'vue';
|
|
const designer = ref();
|
|
// 获取表单 JSON 配置
|
const getJson = () => {
|
console.log(designer.value.getJson());
|
};
|
|
// 加载已有配置
|
const loadJson = (json) => {
|
designer.value.setJson(json);
|
};
|
// 配置项
|
const config = ref({
|
showSaveBtn: true, //保存按钮
|
showPreviewBtn: true, //预览按钮
|
});
|
|
// 保存
|
// https://view.form-create.com/save#%E4%BF%9D%E5%AD%98%E6%95%B0%E6%8D%AE%E7%A4%BA%E4%BE%8B
|
function handleSave(data) {
|
//保存设计规则
|
console.log(data);
|
}
|
</script>
|