1
0
mirror of synced 2025-12-07 22:28:34 +08:00

releases 4.7.16

This commit is contained in:
xuliangzhan
2024-06-14 20:36:56 +08:00
parent af22f2ae51
commit bd0dd9cbc3
3 changed files with 9 additions and 8 deletions

View File

@@ -1,4 +1,5 @@
import { VxeUI } from '@vxe-ui/core'
import { getFuncText } from './src/utils'
import type { VxeUploadDefines, VxeGlobalConfig } from 'vxe-pc-ui'
@@ -270,28 +271,28 @@ export const use = VxeUI.use
* @deprecated
*/
export const setup = (options?: VxeGlobalConfig) => {
return VxeUI.setup(options)
return VxeUI.setConfig(options)
}
/**
* 已废弃
* @deprecated
*/
export const config = (options?: VxeGlobalConfig) => {
return VxeUI.config(options)
return VxeUI.setConfig(options)
}
/**
* 已废弃
* @deprecated
*/
export const t = (key: string, args?: any) => {
return VxeUI.t(key, args)
return VxeUI.getI18n(key, args)
}
/**
* 已废弃
* @deprecated
*/
export const _t = (key: string, args?: any) => {
return VxeUI._t(key, args)
export const _t = (content: string | number | boolean | null | undefined, args?: any) => {
return getFuncText(content, args)
}
/**

View File

@@ -30,10 +30,10 @@ export function hasChildrenList (item: any) {
return item && item.children && item.children.length > 0
}
export function getFuncText (content?: string | number | boolean | null) {
export function getFuncText (content?: string | number | boolean | null, args?: any) {
if (content) {
const translate = VxeUI.getConfig().translate
return XEUtils.toValueString(translate ? translate('' + content) : content)
return XEUtils.toValueString(translate ? translate('' + content, args) : content)
}
return ''
}