mirror of https://github.com/sveltejs/svelte
parent
d707f6a3b2
commit
9977762dd0
@ -0,0 +1,15 @@
|
|||||||
|
<Two bind:foo/>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import Two from './Two.html';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
Two
|
||||||
|
},
|
||||||
|
|
||||||
|
oncreate() {
|
||||||
|
this.snapshot = this.get('foo');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
@ -0,0 +1,15 @@
|
|||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
bar: 1
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
foo(bar) {
|
||||||
|
return bar * 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
@ -0,0 +1,5 @@
|
|||||||
|
export default {
|
||||||
|
test(assert, component) {
|
||||||
|
assert.equal(component.refs.one.snapshot, 2);
|
||||||
|
}
|
||||||
|
};
|
@ -0,0 +1,9 @@
|
|||||||
|
<One ref:one/>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import One from './One.html';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: { One }
|
||||||
|
};
|
||||||
|
</script>
|
Loading…
Reference in new issue