mirror of
https://github.com/youzan/vant.git
synced 2025-10-19 10:07:07 +00:00
[new feature] Pagination code review (#328)
* fix: Tabbar icon line-height * [new feature] progress add showPivot prop * [new feature] TabItem support vue-router * [new feature] update document header style * [Doc] add toast english ducoment * [bugfix] Search box-sizing wrong * [Doc] update vant-demo respo * [Doc] translate theme & demo pages * [Doc] add Internationalization document * [bugfix] remove unnecessary props * [fix] optimize clickoutside * [new feature] optimize find-parent * [new feature]: change document title accordinng to language * [new feature] Pagination code review
This commit is contained in:
@@ -386,6 +386,10 @@ module.exports = {
|
||||
path: '/notice-bar',
|
||||
title: 'NoticeBar'
|
||||
},
|
||||
{
|
||||
path: '/pagination',
|
||||
title: 'Pagination'
|
||||
},
|
||||
{
|
||||
path: '/panel',
|
||||
title: 'Panel'
|
||||
|
@@ -7,6 +7,11 @@ const langMap = {
|
||||
'zh-CN': zhCN
|
||||
};
|
||||
|
||||
const titleMap = {
|
||||
'en-US': 'Vant - A Vue.js 2.0 Mobile UI at YouZan',
|
||||
'zh-CN': 'Vant - 有赞移动端 Vue 组件库'
|
||||
};
|
||||
|
||||
const userLang = window.localStorage.getItem('VANT_LANGUAGE') || window.navigator.language || 'en-US';
|
||||
let defaultLang = 'en-US';
|
||||
if (userLang.indexOf('zh-') !== -1) {
|
||||
@@ -17,4 +22,5 @@ setLang(defaultLang);
|
||||
export function setLang(lang) {
|
||||
window.localStorage.setItem('VANT_LANGUAGE', lang);
|
||||
Locale.use(lang, langMap[lang]);
|
||||
document.title = titleMap[lang];
|
||||
}
|
||||
|
Reference in New Issue
Block a user