-
-
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.
fire oncreate handlers for components inside await blocks (#1061)
- Loading branch information
1 parent
9cfa174
commit c1b5bed
Showing
4 changed files
with
49 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<p>{{value}}</p> | ||
<p>{{called}}</p> | ||
|
||
<script> | ||
export default { | ||
data() { | ||
return { called: false }; | ||
}, | ||
|
||
oncreate() { | ||
this.set({ called: true }); | ||
} | ||
}; | ||
</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,16 @@ | ||
const promise = Promise.resolve(42); | ||
|
||
export default { | ||
data: { | ||
promise | ||
}, | ||
|
||
test(assert, component, target) { | ||
return promise.then(() => { | ||
assert.htmlEqual(target.innerHTML, ` | ||
<p>42</p> | ||
<p>true</p> | ||
`); | ||
}); | ||
} | ||
}; |
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,13 @@ | ||
{{#await promise then value}} | ||
<Foo :value /> | ||
{{/await}} | ||
|
||
<script> | ||
import Foo from './Foo.html'; | ||
|
||
export default { | ||
components: { | ||
Foo | ||
} | ||
}; | ||
</script> |