mirror of
https://gitee.com/dromara/mayfly-go
synced 2026-02-17 17:55:36 +08:00
refactor: code review
This commit is contained in:
@@ -28,17 +28,13 @@
|
||||
<script setup lang="ts" name="SearchFormItem">
|
||||
import { computed } from 'vue';
|
||||
import { SearchItem } from '../index';
|
||||
import { useVModel } from '@vueuse/core';
|
||||
|
||||
interface SearchFormItemProps {
|
||||
modelValue: any;
|
||||
item: SearchItem;
|
||||
}
|
||||
const props = defineProps<SearchFormItemProps>();
|
||||
|
||||
const emit = defineEmits(['update:modelValue']);
|
||||
|
||||
const itemValue = useVModel(props, 'modelValue', emit);
|
||||
const itemValue = defineModel('modelValue');
|
||||
|
||||
// 判断 fieldNames 设置 label && value && children 的 key 值
|
||||
const fieldNames = computed(() => {
|
||||
|
||||
@@ -44,11 +44,9 @@ import Grid from '@/components/Grid/index.vue';
|
||||
import GridItem from '@/components/Grid/components/GridItem.vue';
|
||||
import SvgIcon from '@/components/svgIcon/index.vue';
|
||||
import { SearchItem } from './index';
|
||||
import { useVModel } from '@vueuse/core';
|
||||
|
||||
interface ProTableProps {
|
||||
items: SearchItem[]; // 搜索配置项
|
||||
modelValue?: { [key: string]: any }; // 搜索参数
|
||||
searchCol: number | Record<BreakPoint, number>;
|
||||
search: (params: any) => void; // 搜索方法
|
||||
reset: (params: any) => void; // 重置方法
|
||||
@@ -60,9 +58,7 @@ const props = withDefaults(defineProps<ProTableProps>(), {
|
||||
modelValue: () => ({}),
|
||||
});
|
||||
|
||||
const emit = defineEmits(['update:modelValue']);
|
||||
|
||||
const searchParam = useVModel(props, 'modelValue', emit);
|
||||
const searchParam: any = defineModel('modelValue');
|
||||
|
||||
// 获取响应式设置
|
||||
const getResponsive = (item: SearchItem) => {
|
||||
|
||||
Reference in New Issue
Block a user