基于 Form
组件封装,支持收缩展开。
更复杂例子,请在线预览
<script setup lang="ts">
import { Search } from '@/components/Search'
import { reactive } from 'vue'
const schema = reactive<FormSchema[]>([
{
field: 'field1',
label: 'input',
component: 'Input'
}
])
</script>
<template>
<Search :schema="schema" />
</template>
属性 | 说明 | 类型 | 可选值 | 默认值 |
---|---|---|---|---|
schema | 生成 Search 的布局结构数组,详见 | FormSchema |
- | [] |
isCol | 是否需要栅格布局 | boolean |
- | true |
labelWidth | 表单 label 宽度 | string /number |
- | auto |
layout | 操作按钮风格位置 | string |
inline/bottom | inline |
buttomPosition | 底部操作按钮的对齐方式 | string |
left/center/right | center |
showSearch | 是否显示查询按钮 | boolean |
- | true |
showReset | 是否显示重置按钮 | boolean |
- | true |
expand | 是否显示伸缩按钮 | boolean |
- | false |
expandField | 伸缩的界限字段 | string |
- | - |
方法名 | 说明 | 回调参数 |
---|---|---|
search | 查询后的回调 | data: Recordable |
reset | 重置后的回到 | data: Recordable |