mirror of https://github.com/sveltejs/svelte
handle default paramters in computed values (fixes #274)
parent
17e31dfab3
commit
11e613e7d0
@ -0,0 +1,9 @@
|
|||||||
|
export default {
|
||||||
|
html: '<p>2</p>',
|
||||||
|
|
||||||
|
test ( assert, component, target ) {
|
||||||
|
component.set({ a: 2 });
|
||||||
|
assert.equal( target.innerHTML, '<p>4</p>' );
|
||||||
|
component.teardown();
|
||||||
|
}
|
||||||
|
};
|
@ -0,0 +1,9 @@
|
|||||||
|
<p>{{foo}}</p>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
computed: {
|
||||||
|
foo: ( a = 1 ) => a * 2
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
Loading…
Reference in new issue