For Example:
Register AutoAnimate Directive:
import { registerDirective } from 'omi'
import autoAnimate from '@formkit/auto-animate'
registerDirective('auto-animate', autoAnimate)
Using Directive:
import { render, signal, tag, Component, h } from 'omi'
const show = signal(false)
@tag('my-app')
export class MyApp extends Component {
render() {
return (
<>
<buttton onClick={() => show.value = !show.value}>Toggle show</buttton>
<div o-auto-animate >
{show.value && <h2>Hello o-auto-animate!</h2>}
</div>
</>
)
}
}
render(<my-app />, document.body)