mirror of https://github.com/sveltejs/svelte
parent
66fa88b0cb
commit
abc39eed20
@ -0,0 +1,4 @@
|
|||||||
|
<p>foo: {foo}</p>
|
||||||
|
<p>baz: {baz} ({typeof baz})</p>
|
||||||
|
<p>qux: {qux}</p>
|
||||||
|
<p>quux: {quux}</p>
|
@ -0,0 +1,31 @@
|
|||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
foo: 'lol',
|
||||||
|
baz: 40 + 2,
|
||||||
|
qux: `this is a ${'piece of'} string`,
|
||||||
|
quux: 'core'
|
||||||
|
},
|
||||||
|
|
||||||
|
html: `
|
||||||
|
<div><p>foo: lol</p>
|
||||||
|
<p>baz: 42 (number)</p>
|
||||||
|
<p>qux: named</p>
|
||||||
|
<p>quux: core</p></div>
|
||||||
|
`,
|
||||||
|
|
||||||
|
async test(assert, component, target) {
|
||||||
|
await component.$set({
|
||||||
|
foo: 'wut',
|
||||||
|
baz: 40 + 3,
|
||||||
|
qux: `this is a ${'rather boring'} string`,
|
||||||
|
quux: 'heart'
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.htmlEqual(target.innerHTML, `
|
||||||
|
<div><p>foo: wut</p>
|
||||||
|
<p>baz: 43 (number)</p>
|
||||||
|
<p>qux: named</p>
|
||||||
|
<p>quux: heart</p></div>
|
||||||
|
`);
|
||||||
|
}
|
||||||
|
};
|
@ -0,0 +1,11 @@
|
|||||||
|
<svelte:meta bind:props/>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import Widget from './Widget.html';
|
||||||
|
|
||||||
|
export let props;
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<Widget {...props} qux="named"/>
|
||||||
|
</div>
|
Loading…
Reference in new issue