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:
@@ -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)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user