mirror of https://github.com/sveltejs/svelte
parent
d27e99d239
commit
2686508af3
@ -0,0 +1,3 @@
|
||||
<p>foo: {{foo}}</p>
|
||||
<p>baz: {{baz}} ({{typeof baz}})</p>
|
||||
<p>qux: {{qux}}</p>
|
@ -0,0 +1,19 @@
|
||||
import * as assert from 'assert';
|
||||
|
||||
export default {
|
||||
data: {
|
||||
bar: 'lol',
|
||||
x: 2,
|
||||
compound: 'piece of'
|
||||
},
|
||||
html: `<div><p>foo: lol</p>\n<p>baz: 42 (number)</p>\n<p>qux: this is a piece of string</p></div>`,
|
||||
test ( component, target ) {
|
||||
component.set({
|
||||
bar: 'wut',
|
||||
x: 3,
|
||||
compound: 'rather boring'
|
||||
});
|
||||
|
||||
assert.equal( target.innerHTML, `<div><p>foo: wut</p>\n<p>baz: 43 (number)</p>\n<p>qux: this is a rather boring string</p></div>` );
|
||||
}
|
||||
};
|
@ -0,0 +1,11 @@
|
||||
<div>
|
||||
<Widget foo='{{bar}}' baz='{{40 + x}}' qux='this is a {{compound}} string'/>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
import Widget from './Widget.html';
|
||||
|
||||
export default {
|
||||
components: { Widget }
|
||||
};
|
||||
</script>
|
Loading…
Reference in new issue