diff --git a/examples/app.vue b/examples/app.vue index 6a4fcc57a..02bc19dc4 100644 --- a/examples/app.vue +++ b/examples/app.vue @@ -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) { diff --git a/examples/docs/zh-CN/table.md b/examples/docs/zh-CN/table.md index 779674e0a..b0ad81dc6 100644 --- a/examples/docs/zh-CN/table.md +++ b/examples/docs/zh-CN/table.md @@ -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 ''; diff --git a/packages/date-picker/src/basic/time-spinner.vue b/packages/date-picker/src/basic/time-spinner.vue index b00b8bca6..fd5a680fa 100644 --- a/packages/date-picker/src/basic/time-spinner.vue +++ b/packages/date-picker/src/basic/time-spinner.vue @@ -3,6 +3,7 @@