办学质量监测教学评价系统
Flex
2025-06-17 1122de7de0148a6253587aae82b77229e05c7601
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<template>
  <fc-designer ref="designer" @save="handleSave"  :config="config" />
</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);
};
 
// 保存方法
// https://view.form-create.com/save#%E4%BF%9D%E5%AD%98%E6%95%B0%E6%8D%AE%E7%A4%BA%E4%BE%8B
const handleSave = ({rule, options}) => {
  console.log("你点击了保存按钮")
  console.log("rule", rule)
  console.log("options", options)
}
 
// 配置项
// 详见https://view.form-create.com/ts#%E8%AE%BE%E8%AE%A1%E5%99%A8%E9%85%8D%E7%BD%AE
const config = ref( {
  // 显示保存按钮
  showSaveBtn: true
} )
 
</script>