search.md 1.4 KB

Search 查询组件

基于 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>

Search 属性

属性 说明 类型 可选值 默认值
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 事件

方法名 说明 回调参数
search 查询后的回调 data: Recordable
reset 重置后的回到 data: Recordable