-
-
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.
- Loading branch information
Showing
11 changed files
with
104 additions
and
25 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
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 @@ | ||
<b>{{yield}}</b> |
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,12 @@ | ||
export default { | ||
html: ` | ||
<b>Hello</b> | ||
`, | ||
|
||
test ( assert, component, target ) { | ||
component.set( { name: 'World' } ); | ||
assert.htmlEqual( target.innerHTML, ` | ||
<b>Hello</b> World | ||
` ); | ||
} | ||
}; |
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,12 @@ | ||
<Widget>Hello</Widget> {{name}} | ||
|
||
<script> | ||
import Widget from './Widget.html'; | ||
|
||
export default { | ||
components: { Widget }, | ||
data() { | ||
return { name: '' }; | ||
} | ||
}; | ||
</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,5 @@ | ||
export default { | ||
html: ` | ||
<foo-bar>Hello</foo-bar> | ||
` | ||
} |
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 @@ | ||
<foo-bar>Hello</foo-bar> |
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,24 @@ | ||
export default { | ||
skip: true, // JSDOM | ||
|
||
data: { | ||
options: [ { id: 'a' }, { id: 'b' }, { id: 'c' } ], | ||
selected: 'b' | ||
}, | ||
|
||
test ( assert, component, target, window ) { | ||
const select = target.querySelector( 'select' ); | ||
assert.equal( select.value, 'b' ); | ||
|
||
const event = new window.Event( 'change' ); | ||
|
||
select.value = 'c'; | ||
select.dispatchEvent( event ); | ||
|
||
assert.equal( select.value, 'c' ); | ||
assert.equal( component.get( 'lastChangedTo' ), 'c' ); | ||
assert.equal( component.get( 'selected' ), 'c' ); | ||
|
||
component.destroy(); | ||
} | ||
}; |
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 @@ | ||
<select bind:value="selected" on:change="updateLastChangedTo(selected)"> | ||
{{#each options as option}} | ||
<option value="{{option.id}}">{{option.id}}</option> | ||
{{/each}} | ||
</select> | ||
|
||
<script> | ||
export default { | ||
methods: { | ||
updateLastChangedTo(result) { | ||
this.set({ lastChangedTo: result }); | ||
} | ||
} | ||
}; | ||
</script> |