2
0
mirror of https://github.com/tenrok/maska.git synced 2026-06-05 16:42:28 +03:00

feat: auto init for alpine

This commit is contained in:
Alexander Shabunevich
2024-05-22 21:21:41 +03:00
parent 3676e771f0
commit f6c706f1c8
+7
View File
@@ -12,3 +12,10 @@ import { xMaska } from './alpine'
export { Mask, MaskInput, tokens, xMaska }
export type { MaskaDetail, MaskInputOptions, MaskOptions, MaskTokens, MaskType }
if (document.currentScript?.dataset.init !== undefined) {
document.addEventListener('alpine:init', () => {
// @ts-expect-error
window.Alpine.plugin(xMaska)
})
}