github Tencent/omi v7.1.4
CSS Prop Supported 🎉 !

latest releases: v7.7.0, v7.6.18, v7.6.6...
11 months ago

Usage

@tag('counter-demo')
class CounterDemo extends Component {
  static css = 'span { color: red; }'

  render() {
    return (
      <>
        <button onClick={sub}>-</button>
        <span>{count.value}</span>
        <button onClick={add}>+</button>
      </>
    )
  }
}

@tag('my-app')
class MyApp extends Component {

  cssProp: string = ''

  installed(): void {
    setInterval(() => {
      this.cssProp = `span{ font-size: ${Math.floor(Math.random() * 120)}px }`
      this.update()
    }, 500)

  }
  render() {
    return (
      <counter-demo css={this.cssProp || 'span{ color: green !important}'} />
    )
  }
}

企业微信截图_3f6d7888-2bac-4371-abe1-8552a1838538

Don't miss a new omi release

NewReleases is sending notifications on new releases.