说明
个人记录保存。
javascript
import {ref} from "vue";
export default function useDialog(opts) {
const visible = ref(false)
const loading = ref(false)
const open = (v) => {
visible.value = true
typeof opts.onOpen === "function" && opts.onOpen(v)
}
const close = () => {
visible.value = false
typeof opts.onClose === "function" && opts.onClose()
}
return {
visible,
open,
close,
loading,
}
}