首次提交
This commit is contained in:
16
cdtestplant/src/hooks/loading.ts
Normal file
16
cdtestplant/src/hooks/loading.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { ref } from 'vue'
|
||||
|
||||
export default function useLoading(initValue = false) {
|
||||
const loading = ref(initValue)
|
||||
const setLoading = (value: boolean) => {
|
||||
loading.value = value
|
||||
}
|
||||
const toggle = () => {
|
||||
loading.value = !loading.value
|
||||
}
|
||||
return {
|
||||
loading,
|
||||
setLoading,
|
||||
toggle,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user