UNPKG

tav-ui

Version:
36 lines (31 loc) 825 B
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var vue = require('vue'); var createLoading = require('./createLoading2.js'); function useLoading(opt) { let props; let target = document.body; if (Reflect.has(opt, "target") || Reflect.has(opt, "props")) { const options = opt; props = options.props || {}; target = options.target || document.body; } else { props = opt; } const instance = createLoading.createLoading(props, void 0, true); const open = () => { const t = vue.unref(target); if (!t) return; instance.open(t); }; const close = () => { instance.close(); }; const setTip = (tip) => { instance.setTip(tip); }; return [open, close, setTip]; } exports.useLoading = useLoading; //# sourceMappingURL=useLoading2.js.map