update
init
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import { ref } from 'vue';
|
||||
|
||||
interface TabHooks {
|
||||
activeTab: number;
|
||||
setActiveTab: (index: number) => void;
|
||||
}
|
||||
|
||||
// 1.切换tab
|
||||
export const useTabHooks = (initialTab: number): TabHooks => {
|
||||
const activeTab = ref(initialTab);
|
||||
|
||||
const setActiveTab = (index: number) => {
|
||||
activeTab.value = index;
|
||||
};
|
||||
|
||||
return {
|
||||
activeTab,
|
||||
setActiveTab,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user