Skip to content

Commit

Permalink
2.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
eavichay committed Jan 9, 2017
1 parent aa05c72 commit eb9c8b0
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "slimjs",
"main": "Slim.js",
"version": "2.2.2",
"version": "2.2.3",
"ignore": [
"example",
"components",
Expand Down
16 changes: 14 additions & 2 deletions example/tests/bind-child.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,30 @@
Slim.tag('bind-child', class extends Slim {

get template() {
return `<div bind>[[data.label]] Click for value</div>`
return `<div bind>[[data.label]] Click for value [[updateCount]] / [[renderCount]]</div>`
}

onBeforeCreated() {
this.updateCount = 0;
this.renderCount = 0;
this.customRender = false;
}

update() {
this.updateCount++
super.update()
}

render(tpl) {
this.renderCount++
super.render(tpl)
}

onAfterRender() {
this.onclick = ()=>{
this.customRender = !this.customRender;
if (this.customRender) {
this.render(`<div prop="[[data.label]]" bind>[[data.label]] : [[data.value]]</div>`)
this.render(`<div prop="[[data.label]]" bind>[[data.label]] : [[data.value]] - [[updateCount]] / [[renderCount]]</div>`)
} else {
this.render()
}
Expand Down
2 changes: 1 addition & 1 deletion example/tests/bind-test.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@


<bind-parent>
<bind-child slim-repeat="items" a-prop="[[myProp]]" b-prop="[[urProp]]"></bind-child>
<li slim-repeat="items"><bind-child a-prop="[[myProp]]" b-prop="[[urProp]]"></bind-child></li>
<br/>
<hr/>
<tree-list bind-wprop="[[wProp]]" slim-repeat="tree"></tree-list>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "slim-js",
"version": "2.2.2",
"version": "2.2.3",
"description": "Slim web components infrastructure",
"main": "Slim.js",
"scripts": {
Expand Down

0 comments on commit eb9c8b0

Please sign in to comment.