mirror of https://github.com/sveltejs/svelte
parent
4c2fdcf657
commit
f13c2272df
@ -1 +1,11 @@
|
|||||||
|
<script>
|
||||||
|
import { onDestroy, createEventDispatcher } from 'svelte';
|
||||||
|
|
||||||
|
const dispatch = createEventDispatcher();
|
||||||
|
|
||||||
|
onDestroy(() => {
|
||||||
|
dispatch('destroy');
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
<p>i am a widget</p>
|
<p>i am a widget</p>
|
@ -1,5 +1,5 @@
|
|||||||
export default {
|
export default {
|
||||||
test(assert, component) {
|
test(assert, component) {
|
||||||
component.l1.destroy();
|
component.l1.$destroy();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import Level1 from './Level1.html';
|
import Level1 from './Level1.html';
|
||||||
|
|
||||||
|
export let l1;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Level1 ref:l1 />
|
<Level1 ref:l1 />
|
@ -1,4 +1,4 @@
|
|||||||
<div class="level3" ref:thingy>
|
<div class="level3">
|
||||||
<h4>level 3</h4>
|
<h4>level 3</h4>
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</div>
|
</div>
|
@ -1,7 +1,8 @@
|
|||||||
export default {
|
export default {
|
||||||
html: '<div><p>i am a widget</p></div>',
|
html: '<div><p>i am a widget</p></div>',
|
||||||
|
|
||||||
test(assert, component) {
|
test(assert, component) {
|
||||||
const widget = component.widget;
|
const { widget } = component;
|
||||||
assert.ok(widget.isWidget);
|
assert.ok(widget.isWidget);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in new issue