mirror of https://github.com/sveltejs/svelte
Merge pull request #454 from taylorzane/gh-452-fix-empty-computed
Fixed empty component 'computed' from throwing error.pull/449/merge
commit
6802f43e48
@ -0,0 +1,8 @@
|
||||
export default {
|
||||
html: '<div>empty</div>',
|
||||
test ( assert, component, target ) {
|
||||
assert.equal( component.get( 'created' ), true );
|
||||
assert.equal( target.innerHTML, '<div>empty</div>' );
|
||||
component.destroy();
|
||||
}
|
||||
};
|
@ -0,0 +1,14 @@
|
||||
<div>empty</div>
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {};
|
||||
},
|
||||
|
||||
computed: {},
|
||||
|
||||
oncreate () {
|
||||
this.set({ created: true });
|
||||
}
|
||||
};
|
||||
</script>
|
Loading…
Reference in new issue