Browse Source

Homepage: fix a navigator.language bug (#1040)

杨奕 8 years ago
parent
commit
4f835aa9af
1 changed files with 1 additions and 1 deletions
  1. 1 1
      examples/route.config.js

+ 1 - 1
examples/route.config.js

@@ -91,7 +91,7 @@ route.push({
   component: require('./play/index.vue')
 });
 
-let userLanguage = localStorage.getItem('ELEMENT_LANGUAGE') || window.navigator.language;
+let userLanguage = localStorage.getItem('ELEMENT_LANGUAGE') || window.navigator.language || 'en-US';
 let defaultPath = '/en-US';
 if (userLanguage.indexOf('zh-') !== -1) {
   defaultPath = '/zh-CN';