diff --git a/src/fvcomponents/fvSearchForm/index.vue b/src/fvcomponents/fvSearchForm/index.vue index a9457f8..ef812be 100644 --- a/src/fvcomponents/fvSearchForm/index.vue +++ b/src/fvcomponents/fvSearchForm/index.vue @@ -52,6 +52,16 @@ const props = defineProps({ searchConfig: { type: Array, default: [] + }, + //搜索参数 + searchProp: { + type: String, + default: '' + }, + //搜索值 + searchValue: { + type: String, + default: '' } }) @@ -68,7 +78,10 @@ const filterConfig = computed(() => { }) return arr.length >= 4 && showMore.value ? arr : arr.slice(0, 3) }) - +const setForm=(prop,value)=>{ + form.value[prop]=value + return form.value; +} // 搜索功能表单元素默认值 // const setDefaultFormValues = () => { // filterConfig.value.forEach(item => { @@ -80,6 +93,9 @@ watchEffect(() => { if (filterConfig.value.length) { // setDefaultFormValues() } + if(props.searchProp&&props.searchValue){ + setForm(props.searchProp,props.searchValue) + } }) const elChange = () => { diff --git a/src/views/article-management/index.vue b/src/views/article-management/index.vue index 5d951dc..1fac2d2 100644 --- a/src/views/article-management/index.vue +++ b/src/views/article-management/index.vue @@ -1,7 +1,7 @@