File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -123,10 +123,18 @@ onPageLoad(sink => new Promise((resolve, reject) => {
123123 // })
124124 // // sink.appendToHead(`<script type="text/inject-data">${encodeURIComponent(injectData)}</script>`)
125125
126- const script = ( result . js && `<script type="text/javascript">${ result . js } </script>` ) || ''
126+ let appendHtml
127+ if ( typeof result . appendHtml === "function" ) appendHtml = result . appendHtml ( )
128+
129+ const head = ( ( appendHtml && appendHtml . head ) || result . head ) || ''
130+ const body = ( ( appendHtml && appendHtml . body ) || result . body ) || ''
131+ const js = ( ( appendHtml && appendHtml . js ) || result . js ) || ''
132+
133+ const script = js && `<script type="text/javascript">${ js } </script>`
127134
128135 sink . renderIntoElementById ( VueSSR . outlet , html )
129- sink . appendToBody ( script )
136+ sink . appendToHead ( head )
137+ sink . appendToBody ( [ body , script ] )
130138
131139 resolve ( )
132140 } ,
You can’t perform that action at this time.
0 commit comments