diff --git a/bin/tsw/runtime/Window.js b/bin/tsw/runtime/Window.js index d65f8b93..b13738cc 100644 --- a/bin/tsw/runtime/Window.js +++ b/bin/tsw/runtime/Window.js @@ -21,3 +21,13 @@ Window.prototype.enable = function(){ Window.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:''}; + } + } +});