Releases: Tencent/omi
Releases · Tencent/omi
v7.3.8
v7.3.6
v7.3.5
v7.3.1
Support for injecting lifecycle into props🎉
<my-el onInstalled={e => console.log('installed')}><my-el>
Directive 🎉
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)
Preventing tree shaking
import { Button } from './button' // tree shaking
import './button' // will not tree shaking
class MyApp extends Component {
render() {
return (
<o-button>test</o-buttom>
)
}
}
import { Button } from './button'
class MyApp extends Component {
render() {
return (
{/* will not tree shaking*/ }
<Button.tagName>test</Button.tagName>
)
}
}