mirror of https://github.com/sveltejs/svelte
Merge pull request #1822 from aphitiel/gh-1743
move resize handler from _beforecreate to _after.. (fixes #1743)pull/1887/head
commit
79ea0bd43c
@ -0,0 +1,8 @@
|
||||
export default {
|
||||
'skip-ssr': true,
|
||||
|
||||
test(assert, component, target) {
|
||||
assert.ok(component.onstateRanBeforeOncreate);
|
||||
assert.ok(!component.onupdateRanBeforeOncreate);
|
||||
}
|
||||
};
|
@ -0,0 +1,17 @@
|
||||
<div bind:offsetWidth=width></div>
|
||||
<script>
|
||||
export default {
|
||||
onstate() {
|
||||
this.onstateRan = true;
|
||||
},
|
||||
|
||||
onupdate() {
|
||||
this.onupdateRan = true;
|
||||
},
|
||||
|
||||
oncreate() {
|
||||
this.onstateRanBeforeOncreate = this.onstateRan;
|
||||
this.onupdateRanBeforeOncreate = this.onupdateRan;
|
||||
}
|
||||
};
|
||||
</script>
|
Loading…
Reference in new issue