mirror of
https://github.com/youzan/vant.git
synced 2025-10-22 03:44:48 +00:00
[Doc] update demo
This commit is contained in:
@@ -6,15 +6,8 @@ export default {
|
||||
$t() {
|
||||
const { name } = this.$options;
|
||||
const prefix = name ? camelize(name) + '.' : '';
|
||||
|
||||
if (!this.$vantMessages) {
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
console.error('[Vant] Locale not correctly registered');
|
||||
}
|
||||
return () => '';
|
||||
}
|
||||
|
||||
const messages = this.$vantMessages[this.$vantLang];
|
||||
|
||||
return (path, ...args) => {
|
||||
const message = get(messages, prefix + path) || get(messages, path);
|
||||
return typeof message === 'function' ? message(...args) : message;
|
||||
|
@@ -20,7 +20,14 @@ function iframeReady(iframe, callback) {
|
||||
const ua = navigator.userAgent.toLowerCase();
|
||||
const isMobile = /ios|iphone|ipod|ipad|android/.test(ua);
|
||||
|
||||
function importAll(map, r) {
|
||||
r.keys().forEach(key => {
|
||||
map[key] = r(key);
|
||||
});
|
||||
}
|
||||
|
||||
export {
|
||||
isMobile,
|
||||
importAll,
|
||||
iframeReady
|
||||
};
|
||||
|
@@ -12,6 +12,7 @@ const langMap = {
|
||||
messages: zhCN
|
||||
}
|
||||
};
|
||||
|
||||
let currentLang = '';
|
||||
|
||||
function getDefaultLang() {
|
||||
|
Reference in New Issue
Block a user