feat: 封装全屏加载

This commit is contained in:
xlsea
2024-09-05 11:54:54 +08:00
parent 0c3ea2dc86
commit f2912f64fc
6 changed files with 50 additions and 17 deletions

View File

@ -0,0 +1,25 @@
import { ref } from 'vue';
import { useLoading } from '@sa/hooks';
/** Content Loading */
export default function useContentLoading() {
const description = ref<string>('loading...');
const loading = useLoading();
function startLoading(desc: string = 'loading...') {
description.value = desc;
loading.startLoading();
}
function endLoading() {
description.value = 'loading...';
loading.endLoading();
}
return {
loading: loading.loading,
description,
startLoading,
endLoading
};
}