mirror of
https://github.com/yangjian102621/geekai.git
synced 2026-05-01 23:44:26 +08:00
feat(ul): 顶部信息
This commit is contained in:
10
gpt-vue/projects/vue-admin/src/composables/useState.ts
Normal file
10
gpt-vue/projects/vue-admin/src/composables/useState.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { ref, type Ref } from "vue";
|
||||
function useState<T>(defaultValue?: T): [Ref<T>, (newValue: T) => void] {
|
||||
const state = ref<T>(defaultValue) as Ref<T>;
|
||||
const setState = (newValue: T) => {
|
||||
state.value = newValue;
|
||||
};
|
||||
return [state, setState];
|
||||
}
|
||||
|
||||
export default useState;
|
||||
Reference in New Issue
Block a user