bug fixes

This commit is contained in:
Leopoldthecoder
2017-10-28 15:54:12 +08:00
committed by 杨奕
parent 2e8161e68e
commit 8479b2fbaf
18 changed files with 193 additions and 160 deletions

View File

@@ -202,7 +202,10 @@
},
watch: {
lang() {
lang(val) {
if (val === 'zh-CN') {
this.suggestJump();
}
this.localize();
}
},
@@ -210,11 +213,28 @@
methods: {
localize() {
use(this.lang === 'zh-CN' ? zhLocale : enLocale);
},
suggestJump() {
const href = location.href;
const preferGithub = localStorage.getItem('PREFER_GITHUB');
if (href.indexOf('element-cn') > -1 || preferGithub) return;
setTimeout(() => {
this.$confirm('建议大陆用户访问部署在国内的站点,是否跳转?', '提示')
.then(() => {
location.href = location.href.replace('element.', 'element-cn.');
})
.catch(() => {
localStorage.setItem('PREFER_GITHUB', true);
});
}, 1000);
}
},
mounted() {
this.localize();
if (this.lang === 'zh-CN') {
this.suggestJump();
}
setTimeout(() => {
const notified = localStorage.getItem('RELEASE_NOTIFIED');
if (!notified) {

View File

@@ -298,10 +298,10 @@
return row.tag === value;
},
tableRowClassName({row, rowndex}) {
if (rowndex === 1) {
tableRowClassName({row, rowIndex}) {
if (rowIndex === 1) {
return 'warning-row';
} else if (rowndex === 3) {
} else if (rowIndex === 3) {
return 'success-row';
}
return '';