重构学习任务

This commit is contained in:
田岩
2025-09-12 14:27:18 +08:00
parent 3e2f81bbda
commit ca7f9a09a1
61 changed files with 11150 additions and 305 deletions
+33
View File
@@ -0,0 +1,33 @@
import {
computed,
reactive,
nextTick,
ref
} from 'vue';
export default function useIndexList() {
const tabAct = ref(0);
const listItemRefs = ref([]);
const tabChange = (item) => {
tabAct.value = item.index;
};
const swiperChange = (item) => {
tabAct.value = item.detail.current;
};
const search = (value) => {
console.log('search', value);
listItemRefs.value.forEach((item, index) => {
item?.search(value, tabAct.value === index);
});
};
return {
tabAct,
listItemRefs,
tabChange,
swiperChange,
search,
};
}