-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
always flush render hooks, even if initiator is a nested component
- Loading branch information
Showing
7 changed files
with
100 additions
and
18 deletions.
There are no files selected for viewing
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
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
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
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,16 @@ | ||
<span>{{foo}}</span> | ||
|
||
<script> | ||
export default { | ||
data () { | ||
return { | ||
foo: 'XX' | ||
}; | ||
}, | ||
onrender () { | ||
this.observe( 'item', item => { | ||
this.set({ foo: item }); | ||
}); | ||
} | ||
}; | ||
</script> |
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 @@ | ||
{{#each items as item}} | ||
<Item item={{item}} /> | ||
{{/each}} | ||
|
||
<script> | ||
import Item from './Item.html'; | ||
|
||
export default { | ||
data () { | ||
return { | ||
items: [ 3, 2, 1 ] | ||
}; | ||
}, | ||
methods: { | ||
update () { | ||
this.set({ | ||
items: [ 1, 2, 3, 4, 5 ] | ||
}); | ||
} | ||
}, | ||
components: { | ||
Item | ||
} | ||
}; | ||
</script> |
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,15 @@ | ||
export default { | ||
html: ` | ||
<span>3</span><span>2</span><span>1</span> | ||
`, | ||
|
||
test ( assert, component, target ) { | ||
component.refs.list.update(); | ||
|
||
assert.htmlEqual( target.innerHTML, ` | ||
<span>1</span><span>2</span><span>3</span><span>4</span><span>5</span> | ||
` ); | ||
|
||
component.teardown(); | ||
} | ||
}; |
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,11 @@ | ||
<List ref:list/> | ||
|
||
<script> | ||
import List from './List.html'; | ||
|
||
export default { | ||
components: { | ||
List | ||
} | ||
}; | ||
</script> |