Skip to content
Permalink
Browse files

chore(window): support vue ssr

  • Loading branch information...
yuukiyao
yuukiyao committed Jun 20, 2018
1 parent a66b72c commit d831caee88256fa7f20d370df4ad2bacf8fbc63c
Showing with 10 additions and 0 deletions.
  1. +10 −0 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:''};
}
}
});

0 comments on commit d831cae

Please sign in to comment.
You can’t perform that action at this time.