Skip to content

vue-i18n / general / TranslationProps

接口: TranslationProps

翻译组件 Props

Vue I18n 组件

扩展

属性

i18n?

ts
optional i18n: Composer<{
}, {
}, {
}, string, never, string>;

备注

具有现有作用域的组合式实例。

此选项优先于 scope 选项。

继承自

BaseFormatProps.i18n


keypath

ts
keypath: string;

备注

可以指定区域信息键的属性


locale?

ts
optional locale: string;

备注

指定要在组件中使用的语言环境。

如果指定,则不会覆盖目标组件的全局作用域或父级作用域的语言环境,将使用指定的语言环境。

继承自

BaseFormatProps.locale


plural?

ts
optional plural: string | number;

备注

选择消息数量的复数属性


scope?

ts
optional scope: ComponentI18nScope;

备注

指定要在目标组件中使用的作用域。

您可以指定 globalparent

如果指定 global,则使用全局作用域;如果指定 parent,则使用目标组件的父级作用域。

如果父级是全局作用域,则使用全局作用域;如果是局部作用域,则使用局部作用域。

继承自

BaseFormatProps.scope


tag?

ts
optional tag: string | object;

备注

用于包装插槽中分发的内容。如果省略,则插槽内容被视为 Fragments。

您可以指定基于字符串的标签名称,例如 p,或者组件定义的对象。

继承自

BaseFormatProps.tag