UNPKG

mine-h5-ui

Version:

一款轻量级、模块化基于 Vue3.x 的 H5 前端 UI 组件库 👍

34 lines (33 loc) 721 B
import { ref as s, watch as l } from "vue"; import i from "../node_modules/html2canvas/dist/html2canvas.esm.js"; /*! * mine-h5-ui v2.15.0 * Copyright (c) 2025 biaov * @license MIT */ const f = (o, n) => { const c = s(), a = (t) => { n("click", t); }, r = (t) => { const e = document.createElement("a"); e.href = t, e.download = `${o.imageName}.png`, e.click(); }, m = () => { i(c.value).then((t) => { const e = t.toDataURL(); o.allowDown && r(e), n("end", e, t); }); }; return l( () => o.start, (t) => { t && m(); }, { immediate: !0 } ), { screenshotRef: c, onClick: a }; }; export { f as useHandler };