提交 5077e0fc 编写于 作者: D DCloud_LXH

fix(mp-weixin): getApp is not Function

上级 f6aac783
import { normalizeLocale, LOCALE_EN } from '../helpers/i18n/index'
import { isFn } from 'uni-shared'
export function getLocale () {
// 优先使用 $locale
const app = getApp({
allowDefault: true
})
if (app && app.$vm) {
return app.$vm.$locale
if (isFn(getApp)) {
const app = getApp({
allowDefault: true
})
if (app && app.$vm) {
return app.$vm.$locale
}
}
return normalizeLocale(__GLOBAL__.getSystemInfoSync().language) || LOCALE_EN
}
export function setLocale (locale) {
const app = getApp()
const app = isFn(getApp) ? getApp() : false
if (!app) {
return false
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册