File tree Expand file tree Collapse file tree 2 files changed +16
-10
lines changed
Expand file tree Collapse file tree 2 files changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -139,6 +139,10 @@ export function getObject (ctx = {}) {
139139}
140140
141141export default {
142+ parseSSR ( /* ssrContext */ ssr ) {
143+ return ssr ? getObject ( { ssr } ) : this
144+ } ,
145+
142146 install ( { $q, queues } ) {
143147 if ( isSSR ) {
144148 queues . server . push ( ( q , ctx ) => {
Original file line number Diff line number Diff line change @@ -205,21 +205,23 @@ export default {
205205 touch : false ,
206206 webStorage : false
207207 } ,
208- within : {
209- iframe : false
208+ within : { iframe : false } ,
209+
210+ parseSSR ( /* ssrContext */ ssr ) {
211+ return ssr ? {
212+ is : getPlatform ( ssr . req . headers [ 'user-agent' ] ) ,
213+ has : this . has ,
214+ within : this . within
215+ } : {
216+ is : getPlatform ( ) ,
217+ ...getClientProperties ( )
218+ }
210219 } ,
211220
212221 install ( $q , queues , Vue ) {
213222 if ( isSSR ) {
214223 queues . server . push ( ( q , ctx ) => {
215- q . platform = {
216- is : getPlatform ( ctx . ssr . req . headers [ 'user-agent' ] ) ,
217- has : {
218- touch : false ,
219- webStorage : false
220- } ,
221- within : { iframe : false }
222- }
224+ q . platform = this . parseSSR ( ctx . ssr )
223225 } )
224226 return
225227 }
You can’t perform that action at this time.
0 commit comments