UNPKG

@wfrog/vc

Version:

`自用` 的基于 `element-plus` 二次封装的 `vue3` 组件库。追求在业务场景中,尽可能使用更少的代码量来实现需求。 因此在组件封装上,以 `方便` 为主,打包仅 `esm` 模式。

22 lines (21 loc) 643 B
// src/directives/cleave/index.ts import { loader } from "@wfrog/utils"; var cleave = { mounted: async (el, binding) => { const Cleave = await loader.loadCdnSingle("cleave"); const [elInput] = el.getElementsByTagName("input"); elInput.cleave = new Cleave(elInput, binding.value || {}); }, updated: (el) => { const event = new Event("input", { bubbles: true }); const [elInput] = el.getElementsByTagName("input"); setTimeout(() => { elInput.value = elInput.cleave.properties.result; elInput.dispatchEvent(event); }, 100); } }; var cleave_default = cleave; export { cleave_default as default };