Marek Piasecki
2 years ago
1 changed files with 36 additions and 10 deletions
@ -1,16 +1,42 @@ |
|||||
export let state = { |
import "./router_tag.imba" |
||||
count: 0 |
import { compact, fromPairs, chunk, includes, reject, toPairs, flatten } from 'lodash' |
||||
} |
|
||||
|
|
||||
export def increment |
let helpers = |
||||
state.count++ |
compact: compact |
||||
|
fromPairs: fromPairs |
||||
|
chunk: chunk |
||||
|
includes: includes |
||||
|
reject: reject |
||||
|
toPairs: toPairs |
||||
|
flatten: flatten |
||||
|
|
||||
|
R.init(helpers: helpers, views: ['a', 'b', 'c'], root: 'a', render: imba.commit) |
||||
|
|
||||
|
tag view-a |
||||
|
<self><h1> 'a' |
||||
|
|
||||
|
tag view-b |
||||
|
<self><h1> 'b' |
||||
|
|
||||
|
tag view-c |
||||
|
<self><h1> 'c' |
||||
|
|
||||
|
R.setters.e = do |v| "--{v}" |
||||
|
R.getters.e = do |v| v.slice(2) |
||||
|
tag view-e |
||||
|
<self><h1> 'e' |
||||
|
|
||||
tag app |
tag app |
||||
<self@click=increment> "count is {state.count}" |
<self[d:bbox]> |
||||
css d:inline-block us:none cursor:pointer fs:6 p:2.5 5 rd:2.5 |
<pro-ref view=v> v for v in R.views |
||||
tween:box-shadow 250ms, background-color 250ms |
<pro-ref view="d"> 'd' |
||||
ff:Arial c:black/87 bg:indigo4 bxs:xs |
<pro-toggle param="O"> |
||||
@hover bg:indigo3 bxs:lg |
<label> "O" |
||||
|
<input type='checkbox' checked=R.param('O')> |
||||
|
<pro-ref view="b" params={ project: 2}> "b/project/2" |
||||
|
<pro-ref-f view="c" params={ book: 3}> "c/book/3" |
||||
|
<pro-router> |
||||
|
<input$v type='text' value=R.param('e') @keyup=R.write('e', $v.value)> |
||||
|
|
||||
if import.meta.env.MODE is 'development' |
if import.meta.env.MODE is 'development' |
||||
imba.mount <app> |
imba.mount <app> |
||||
|
Loading…
Reference in new issue