This commit is contained in:
dntzhang 2018-11-14 09:35:36 +08:00
parent 732bc3ec02
commit b9c19b3bf8
2 changed files with 13 additions and 18 deletions

View File

@ -2,21 +2,16 @@ import { define, render, WeElement } from '../../src/omi'
import tpl from './my-template'
define('my-app', class extends WeElement {
css() {
return `
css() {
return `
div{
color: green;
}`
}
}
render(props, data) {
return (
<div>
{tpl({ name: 'zhanglei', age: 18 })}
</div>
)
}
render() {
return <div>{tpl({ name: 'zhanglei', age: 18 })}</div>
}
})
render(<my-app name="Omi v4.0" />, 'body')

View File

@ -1,8 +1,8 @@
export default function tpl(data){
return (
<div>
<div>name: {data.name}</div>
<div>age: {data.age}</div>
</div>
)
export default function tpl(data) {
return (
<div>
<div>name: {data.name}</div>
<div>age: {data.age}</div>
</div>
)
}