mirror of https://github.com/sveltejs/svelte
Merge pull request #1029 from sveltejs/gh-1028-followup
get store() to work with nested components in SSR compilerpull/1030/head
commit
a5f816f618
@ -0,0 +1 @@
|
|||||||
|
<p>It's nice to see you, {{$name}}.</p>
|
@ -1,9 +1,17 @@
|
|||||||
export default {
|
export default {
|
||||||
html: `<h1>Hello world!</h1>`,
|
store: true, // TODO remove this in v2
|
||||||
|
|
||||||
|
html: `
|
||||||
|
<h1>Hello world!</h1>
|
||||||
|
<p>It's nice to see you, world.</p>
|
||||||
|
`,
|
||||||
|
|
||||||
test(assert, component, target) {
|
test(assert, component, target) {
|
||||||
component.store.set({ name: 'everybody' });
|
component.store.set({ name: 'everybody' });
|
||||||
|
|
||||||
assert.htmlEqual(target.innerHTML, `<h1>Hello everybody!</h1>`);
|
assert.htmlEqual(target.innerHTML, `
|
||||||
|
<h1>Hello everybody!</h1>
|
||||||
|
<p>It's nice to see you, everybody.</p>
|
||||||
|
`);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -1,11 +1,19 @@
|
|||||||
<h1>Hello {{$name}}!</h1>
|
<h1>Hello {{$name}}!</h1>
|
||||||
|
<Nested/>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Store } from '../../../../store.js';
|
import { Store } from '../../../../store.js';
|
||||||
export default {
|
import Nested from './Nested.html';
|
||||||
store () {
|
|
||||||
return new Store({
|
export default {
|
||||||
name: 'world'
|
store () {
|
||||||
});
|
return new Store({
|
||||||
}
|
name: 'world'
|
||||||
}
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
components: {
|
||||||
|
Nested
|
||||||
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in new issue