mirror of https://github.com/sveltejs/svelte
Merge pull request #276 from sveltejs/gh-274
handle default parameters in computed valuespull/281/head
commit
face13a703
@ -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