File tree 4 files changed +32
-1
lines changed
src/generators/server-side-rendering
test/runtime/samples/store-nested
4 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -114,7 +114,6 @@ export default function ssr(
114
114
}
115
115
116
116
var result = { head: '', addComponent };
117
- ${ templateProperties . store && `options.store = %store();` }
118
117
var html = ${ name } ._render(result, state, options);
119
118
120
119
var cssCode = Array.from(components).map(c => c.css && c.css.code).filter(Boolean).join('\\n');
@@ -130,6 +129,7 @@ export default function ssr(
130
129
}
131
130
132
131
${ name } ._render = function(__result, state, options) {
132
+ ${ templateProperties . store && `options.store = %store();` }
133
133
__result.addComponent(${ name } );
134
134
135
135
state = Object.assign(${ initialState . join ( ', ' ) } );
Original file line number Diff line number Diff line change
1
+ < h1 > Hello, {{$name}}!</ h1 >
2
+
3
+ < script >
4
+ import { Store } from '../../../../store.js' ;
5
+
6
+ export default {
7
+ store ( ) {
8
+ return new Store ( {
9
+ name : 'world'
10
+ } ) ;
11
+ } ,
12
+ } ;
13
+ </ script >
Original file line number Diff line number Diff line change
1
+ export default {
2
+ store : true , // TODO remove this in v2
3
+
4
+ html : `
5
+ <h1>Hello, world!</h1>
6
+ ` ,
7
+ } ;
Original file line number Diff line number Diff line change
1
+ < Nested />
2
+
3
+ < script >
4
+ import Nested from './Nested.html' ;
5
+
6
+ export default {
7
+ components : {
8
+ Nested
9
+ }
10
+ } ;
11
+ </ script >
You can’t perform that action at this time.
0 commit comments