CN-53 perf: cn-53第三条,column和legend国际化

This commit is contained in:
chenjinsong
2021-07-14 15:40:05 +08:00
parent 2e2b197b90
commit 8a0eb23e2d
7 changed files with 183 additions and 148 deletions

View File

@@ -255,9 +255,9 @@ export const cancelWithChange = {
function domClick (e) {
const newValue = JSON.parse(JSON.stringify(binding.value.object))
if (unsavedChange === 'on' && !isEqual(oldValue, newValue)) {
ElMessageBox.confirm(i18n.t('tip.confirmCancel'), {
confirmButtonText: i18n.t('tip.yes'),
cancelButtonText: i18n.t('tip.no'),
ElMessageBox.confirm(i18n.global.t('tip.confirmCancel'), {
confirmButtonText: i18n.global.t('tip.yes'),
cancelButtonText: i18n.global.t('tip.no'),
type: 'warning'
}).then(() => {
if (binding.value.func) {
@@ -393,6 +393,12 @@ export function lineToHump (name) {
return letter.toUpperCase()
})
}
// 下划线转换空格首位大写
export function lineToSpace (name) {
return _.upperFirst(name.replace(/\_(\w)/g, function (all, letter) {
return ` ${letter.toUpperCase()}`
}))
}
// 驼峰转换下划线
export function humpToLine (name) {
return name.replace(/([A-Z])/g, '_$1').toLowerCase()