package.src.directives.x-ignore.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of alpinejs Show documentation
Show all versions of alpinejs Show documentation
The rugged, minimal JavaScript framework
import { directive } from "../directives"
let handler = () => {}
handler.inline = (el, { modifiers }, { cleanup }) => {
modifiers.includes('self')
? el._x_ignoreSelf = true
: el._x_ignore = true
cleanup(() => {
modifiers.includes('self')
? delete el._x_ignoreSelf
: delete el._x_ignore
})
}
directive('ignore', handler)