diff --git a/bin/tsw/runtime/Window.js b/bin/tsw/runtime/Window.js index 34c4f0ac..8f6be4e2 100644 --- a/bin/tsw/runtime/Window.js +++ b/bin/tsw/runtime/Window.js @@ -22,3 +22,13 @@ Window.prototype.enable = function() { global.windowHasDisabled = false; }; +//兼容vue-server-render +Object.defineProperty(Window.prototype, 'navigator', { + get : function(){ + if(this.request) { + return {userAgent:this.request.headers['user-agent']}; + }else { + return {userAgent:''}; + } + } +});