docs:fix example

fix HelloElement example , There may be event binding error, data.abc props are not defined
This commit is contained in:
wxy521 2021-05-16 21:12:06 +08:00 committed by GitHub
parent 6e41ef3b02
commit 66e44d73ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -793,7 +793,7 @@ import { define, WeElement } from 'omi'
define('hello-element', class extends WeElement {
onClick = evt => {
// trigger CustomEvent
this.fire('abc', { name: 'dntzhang', age: 12 })
this.fire('Abc', { name: 'dntzhang', age: 12 })
evt.stopPropagation()
}
@ -840,10 +840,10 @@ define('my-app', class extends WeElement {
color: green;
}`
render(props, data) {
render(props) {
return (
<div>
Hello {data.abc}
Hello {this.data.abc}
<hello-element
onAbc={this.onAbc}
msg="WeElement"