github Tencent/omi v6.8.0

latest releases: v7.7.0, v7.6.18, v7.6.6...
5 years ago

New syntax, prop supports reading prop from data center - Omi.$

Example

Define element:

import { define, WeElement } from 'omi'

define('my-ele', class extends WeElement {
  static propTypes = {
    user: Object
  }

  render(props) {
    return (
      <div>name: {props.user.name}, age: {props.user.age}</div>
    )
  }
})

Using Element in others framework or pure js:

<script>
  Omi.$.user = { name: 'dntzhang', age: 18 }
</script>
<my-ele user=":user" ></my-ele>

Also supports path:

<other-ele age=":user.age" ></other-ele>

Don't miss a new omi release

NewReleases is sending notifications on new releases.