Ai
1 Star 1 Fork 1

沉默小管/uniChat

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
index.ts 1.23 KB
一键复制 编辑 原始数据 按行查看 历史
沉默小管 提交于 2023-07-06 14:53 +08:00 . ui界面换uview-plus
/*- coding = utf-8 -*-
@Time : 2023/7/4 14:27
@Author : 管茂良
@File : index.ts
@web : www.php-china.com
@Software: WebStorm
*/
import Loading from "@/components/loading/index"
import {createApp, ref} from "vue";
import {modeType} from "@/components/loading/types";
interface propsInterface{
isShowLoading?:boolean,
loadingMode?:modeType,
loadingSize?:number,
loadingTitle?:string,
}
const parentNode = document.createElement('div')
parentNode.setAttribute("id","loading-style")
let options = ref<propsInterface>({
isShowLoading:false,
loadingMode:"circle",
loadingSize:60,
loadingTitle:"加载中...",
})
const handleLoad = ()=> {
const loadingInstance =(options?:any)=>{
return createApp(Loading,{
...options
})
}
const show = (obj?:propsInterface)=>{
options.value = {...obj}
options.value.isShowLoading = true;
document.body.appendChild(parentNode)
loadingInstance(options.value).mount(parentNode)
}
const hide = () => {
options.value.isShowLoading = false;
let loadingStyle = document.querySelector("#loading-style")
document.body.removeChild(loadingStyle)
}
return {show,hide}
}
export default handleLoad
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/derekgo/uni-chat.git
git@gitee.com:derekgo/uni-chat.git
derekgo
uni-chat
uniChat
master

搜索帮助