Skip to content

vue-i18n / general / FormattableProps

接口:FormattableProps<Value, Format>

格式化属性

备注

在 DatetimeFormat 或 NumberFormat 组件中使用的属性

Vue I18n 组件

扩展

类型参数

类型参数
Value
Format

属性

format?

ts
optional format: string | Format;

备注

在目标组件中使用的格式。

指定格式键字符串或由 ECMA 402 中的 Intl API 定义的格式。


i18n?

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

备注

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

此选项优先于 scope 选项。

继承自

BaseFormatProps.i18n


locale?

ts
optional locale: string;

备注

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

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

继承自

BaseFormatProps.locale


scope?

ts
optional scope: ComponentI18nScope;

备注

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

您可以指定 globalparent

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

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

继承自

BaseFormatProps.scope


tag?

ts
optional tag: string | object;

备注

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

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

继承自

BaseFormatProps.tag


value

ts
value: Value;

备注

为目标组件指定的值