mirror of https://github.com/sveltejs/svelte
attach options to component (#550)
parent
87ef5ffefd
commit
d8269b3e7f
@ -0,0 +1,12 @@
|
||||
export default {
|
||||
'skip-ssr': true,
|
||||
html: `<p>from this.options</p>`,
|
||||
|
||||
options: {
|
||||
text: 'from this.options'
|
||||
},
|
||||
|
||||
test(assert, component) {
|
||||
assert.equal(component.options.text, 'from this.options');
|
||||
}
|
||||
};
|
@ -0,0 +1,11 @@
|
||||
<p>{{text}}</p>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
oncreate() {
|
||||
this.set({
|
||||
text: this.options.text
|
||||
});
|
||||
}
|
||||
};
|
||||
</script>
|
Loading…
Reference in new issue