[Doc] optimzie demo display (#626)

This commit is contained in:
neverland
2018-02-08 15:58:27 +08:00
committed by GitHub
parent 6ed43f8c75
commit 267390212b
10 changed files with 139 additions and 55 deletions
+6
View File
@@ -12,6 +12,7 @@ const langMap = {
messages: zhCN
}
};
let currentLang = '';
setLang(getDefaultLang());
@@ -30,6 +31,11 @@ function getDefaultLang() {
}
export function setLang(lang) {
if (currentLang === lang) {
return;
}
currentLang = lang;
if (window.localStorage) {
localStorage.setItem('VANT_LANGUAGE', lang);
}