fix: 当获取不到lang的时候提供默认值

This commit is contained in:
2024-03-25 16:27:00 +08:00
parent 726c16a29d
commit 3c3114985b

View File

@@ -81,7 +81,11 @@ Vue.use(Element, {
Vue.prototype.$langPre = {
computedProp(suffix) {
return localStorage.getItem('lang') + '_' + suffix
let item = localStorage.getItem('lang');
if (item === null) {
item = 'zh'
}
return item + '_' + suffix
}
}