element-ui国际化
文章目录
<!--let value = i18nHandler.apply(this, arguments);-->
<!--if (value !== null && value !== undefined) return value;-->
const array = path.split('.');
let current = lang;
for (let i = 0, j = array.length; i < j; i++) {
const property = array[i];
value = current[property];
if (i === j - 1) return format(value, options);
if (!value) return '';
current = value;
}
return '';
};
可以把取得如下对象的值 t('el.colorpicker.confirm')
colorpicker: {
confirm: '确定',
clear: '清空'
},
...
}

评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论