omim - add omi demo
This commit is contained in:
parent
bd76eb3ee2
commit
8f7847feea
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,14 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
|
||||
<script src="bundle.omi.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -0,0 +1,22 @@
|
|||
import '../../src/icon-button/index.tsx'
|
||||
|
||||
import { define, WeElement, render, h } from 'omi'
|
||||
|
||||
define('my-app', class extends WeElement {
|
||||
|
||||
|
||||
onChange = (evt) => {
|
||||
this.result = evt.detail.isOn
|
||||
this.update()
|
||||
}
|
||||
|
||||
result = false
|
||||
|
||||
render() {
|
||||
return <div>
|
||||
<p>The switch is {this.result? 'on' : 'off'}.</p>
|
||||
<m-icon-button color="red" icons={['favorite', 'favorite_border']} onChange={this.onChange}></m-icon-button>
|
||||
</div>
|
||||
}
|
||||
})
|
||||
render(<my-app />, 'body')
|
Loading…
Reference in New Issue