-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
only set ref to null when tearing down if it is still current – closes …
- Loading branch information
1 parent
4d842ab
commit c1d230d
Showing
4 changed files
with
30 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
export default { | ||
data: { | ||
x: true | ||
}, | ||
|
||
html: '<canvas data-x="true"></canvas>', | ||
|
||
test ( assert, component, target ) { | ||
let canvas = target.querySelector( 'canvas' ); | ||
assert.equal( canvas, component.refs.foo ); | ||
assert.equal( canvas.getAttribute( 'data-x' ), 'true' ); | ||
|
||
component.set({ x: false }); | ||
canvas = target.querySelector( 'canvas' ); | ||
assert.equal( canvas, component.refs.foo ); | ||
assert.equal( canvas.getAttribute( 'data-x' ), 'false' ); | ||
|
||
component.set({ x: true }); | ||
canvas = target.querySelector( 'canvas' ); | ||
assert.equal( canvas, component.refs.foo ); | ||
assert.equal( canvas.getAttribute( 'data-x' ), 'true' ); | ||
} | ||
}; |
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,5 @@ | ||
{{#if x}} | ||
<canvas ref:foo data-x='true'></canvas> | ||
{{else}} | ||
<canvas ref:foo data-x='false'></canvas> | ||
{{/if}} |