mirror of
https://github.com/tenrok/maska.git
synced 2026-06-20 20:00:34 +03:00
feat: auto init for alpine
This commit is contained in:
@@ -12,3 +12,10 @@ import { xMaska } from './alpine'
|
|||||||
|
|
||||||
export { Mask, MaskInput, tokens, xMaska }
|
export { Mask, MaskInput, tokens, xMaska }
|
||||||
export type { MaskaDetail, MaskInputOptions, MaskOptions, MaskTokens, MaskType }
|
export type { MaskaDetail, MaskInputOptions, MaskOptions, MaskTokens, MaskType }
|
||||||
|
|
||||||
|
if (document.currentScript?.dataset.init !== undefined) {
|
||||||
|
document.addEventListener('alpine:init', () => {
|
||||||
|
// @ts-expect-error
|
||||||
|
window.Alpine.plugin(xMaska)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user