-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
木瓜丸
committed
Dec 3, 2020
1 parent
7401ccb
commit 3dd0ebd
Showing
10 changed files
with
3,644 additions
and
227 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import {Component, html} from '../../dist/onigiri.js'; | ||
|
||
class TestComponent extends Component { | ||
init() { | ||
return { | ||
attr: 'hello', | ||
content: 'control' | ||
} | ||
} | ||
update(state) { | ||
return { | ||
attr: state.attr + 'e', | ||
content: state.content + 'c' | ||
} | ||
} | ||
render(state) { | ||
return html` | ||
<div id=${state.attr} @click=${e => this.dispatch('update')}> | ||
${state.content} | ||
</div> | ||
`; | ||
} | ||
} | ||
|
||
customElements.define('test-component', TestComponent); |
Oops, something went wrong.