Skip to content

Releases: Tencent/omi

Fix inner fragment tag render error

12 Apr 14:53
Compare
Choose a tag to compare
import { define, h } from '../../src/omi'

define('my-component', _ => {
  return h('svg', null,
    h(h.f, null,
      h("circle", {
        cx: "18",
        cy: "4.54",
        r: "2"
      }),
      h("path", {
        d: "M15 17h-2c0 1.65-1.35 3-3 3s-3-1.35-3-3 1.35-3 3-3v-2c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5zm3-3.5h-1.86l1.67-3.67C18.42 8.5 17.44 7 15.96 7h-5.2c-.81 0-1.54.47-1.87 1.2L8.22 10l1.92.53.65-1.53H13l-1.83 4.1c-.6 1.33.39 2.9 1.85 2.9H18v5h2v-5.5c0-1.1-.9-2-2-2z"
      })))
})

Fix render null error when first time rendering

31 Mar 03:36
Compare
Choose a tag to compare
v6.17.1

chore: update dependencies of o-table

Support use prop and useSelf prop

20 Dec 09:01
Compare
Choose a tag to compare
import { render, define, h } from 'omi'

const store = {
  data: {
    count: 1
  }
}

store.sub = () => {
  store.data.count--
}

store.add = () => {
  store.data.count++
}

define('my-counter', _ => (
  <h.f>
    <button onClick={_.store.sub}>-</button>
    <span>{_.store.data.count}</span>
    <button onClick={_.store.add}>+</button>
  </h.f>
))

define('my-app', _ => (
  <div>
    <my-counter use={['count']} ></my-counter>
  </div>
))

render(<my-app />, 'body', store)

Compute and Computed

29 Oct 05:58
Compare
Choose a tag to compare

You can implement computed props through compute, such as:

define('my-counter', _ => (
  <div>
    <button onClick={_.store.sub}>-</button>
    <span>{_.store.data.count}</span>
    <button onClick={_.store.add}>+</button>
    <div>Double: {_.computed.doubleCount}</div>
  </div>
), {
    use: ['count'],
    compute: {
      doubleCount() {
        return this.count * 2
      }
    }
  })

v6.15.8

28 Oct 06:39
Compare
Choose a tag to compare
  • Support custom methods
define('my-component', _ => (
  ...
  ...
), {
   
    //here!!
    myMethodA() { },
    myMethodB() { }

  })

v6.15.7

28 Oct 03:33
Compare
Choose a tag to compare
  • Fix event binding testing of custom elements everywhere project, bind lower case events when they belong to built-in events

v6.15.6

16 Oct 08:00
Compare
Choose a tag to compare
  • Fix error in recycling store’s components when uninstall

v6.15.5

15 Oct 11:29
Compare
Choose a tag to compare
  • Fragment supported

Babel config:

{
  "presets": [
    "@babel/preset-env",
    [
      "@babel/preset-react",
      {
        "pragma": "Omi.h",
        "pragmaFrag": "Omi.h.f"
      }
    ]
  ]
}

v6.15.4

15 Oct 08:52
Compare
Choose a tag to compare
  • Fix render array error
  • More unit testing

v6.15.1

08 Oct 02:39
Compare
Choose a tag to compare
  • Romove dead code of define method