提交 22c5223e 编写于 作者: Q qiang

Merge branch 'dev' into alpha

......@@ -206,6 +206,15 @@ module.exports = function chainWebpack (platformOptions, vueOptions, api) {
if (process.env.BUILD_ENV === 'ali-ide') {
webpackConfig.plugins.delete('progress')
}
// webpack4 support import mjs
if (webpack.version[0] < 5) {
webpackConfig.module
.rule('mjs')
.test(/.mjs$/)
.type('javascript/auto')
}
webpackConfig.resolve.alias
.delete('@')
.set(
......
因为 它太大了无法显示 source diff 。你可以改为 查看blob
......@@ -130,8 +130,14 @@ export function formatI18n (message) {
function resolveJsonObj (jsonObj, names) {
if (names.length === 1) {
if (jsonObj) {
const value = jsonObj[names[0]]
if (isStr(value) && isI18nStr(value, I18N_JSON_DELIMITERS)) {
const _isI18nStr = (value) => isStr(value) && isI18nStr(value, I18N_JSON_DELIMITERS)
const _name = names[0]
let filterJsonObj = []
if (Array.isArray(jsonObj) && (filterJsonObj = jsonObj.filter(item => _isI18nStr(item[_name]))).length) {
return filterJsonObj
}
const value = jsonObj[_name]
if (_isI18nStr(value)) {
return jsonObj
}
}
......@@ -151,15 +157,20 @@ export function defineI18nProperty (obj, names) {
return false
}
const prop = names[names.length - 1]
let value = jsonObj[prop]
Object.defineProperty(jsonObj, prop, {
get () {
return formatI18n(value)
},
set (v) {
value = v
}
})
if (Array.isArray(jsonObj)) {
jsonObj
.forEach(item => defineI18nProperty(item, [prop]))
} else {
let value = jsonObj[prop]
Object.defineProperty(jsonObj, prop, {
get () {
return formatI18n(value)
},
set (v) {
value = v
}
})
}
return true
}
......@@ -171,7 +182,8 @@ export function initNavigationBarI18n (navigationBar) {
if (isEnableLocale()) {
return defineI18nProperties(navigationBar, [
['titleText'],
['searchInput', 'placeholder']
['searchInput', 'placeholder'],
['buttons', 'text']
])
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册