// 搜索功能 // 获取搜索框内容 const dateOne=ref('') const dateTwo=ref('') // 重新创建数组 const itemList = ref([]); const query=()=>{ console.log(formattedDateTime.value); console.log(list.value); itemList.value = list.value.filter(item => { //获取数据框的内容是否与列表数据一致 const isMatchingKeyword = !formattedDateTime.value || item.start === formattedDateTime.value;; const isMatchingKeywords = !formattedDateTimeTwo.value || item.over === formattedDateTimeTwo.value;; const isMatchingzname = !value.value || item.zname === value.value; return isMatchingKeyword && isMatchingzname&&isMatchingKeywords; }); console.log(itemList.value); if (value.value!="" ||dateOne.value!=""||dateTwo.value!="") { list.value=itemList.value }else{ ListData() } value.value="", dateOne.value="", dateTwo.value="" }