Intl.ListFormat.prototype.resolvedOptions()
method returns a new object with properties reflecting the locale and style formatting options computed during the construction of the current
ListFormat
对象。
listFormat.resolvedOptions()
An object with properties reflecting the locale and formatting options computed during the construction of the given
ListFormat
对象。
The object returned by
resolvedOptions()
has the following properties:
locale
locale
.
style
options
argument of the constructor or the default value (
"long"
). Its value is either
"long"
,
"short"
,或
"narrow"
.
type
options
argument of the constructor or the default value (
"conjunction"
). Its value is either
"conjunction"
,
"disjunction"
,或
"unit"
.
const deListFormatter = new Intl.ListFormat("de-DE", { style: "short" });
const usedOptions = de.resolvedOptions();
console.log(usedOptions.locale); // "de-DE"
console.log(usedOptions.style); // "short"
console.log(usedOptions.type); // "conjunction" (the default value)
| 规范 |
|---|
|
Intl.ListFormat
The definition of 'resolvedOptions()' in that specification. |
| Desktop | Mobile | Server | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
resolvedOptions
|
Chrome 72 | Edge No | Firefox 78 | IE No | Opera 60 | Safari No | WebView Android 72 | Chrome Android 72 | Firefox Android No | Opera Android 51 | Safari iOS No | Samsung Internet Android No |
nodejs
12.0.0
|
完整支持
不支持
实验。期望将来行为有所改变。
见实现注意事项。
Intl.ListFormat
Intl.NumberFormat.prototype.resolvedOptions()
Intl.Collator.prototype.resolvedOptions()
Intl.DateTimeFormat.prototype.resolvedOptions()
Intl.PluralRules.prototype.resolvedOptions()
Intl
Collator
DateTimeFormat
ListFormat
NumberFormat
PluralRules
RelativeTimeFormat
Object
Object.prototype.__defineGetter__()
Object.prototype.__defineSetter__()
Object.prototype.__lookupGetter__()
Object.prototype.__lookupSetter__()
Object.prototype.hasOwnProperty()
Object.prototype.isPrototypeOf()
Object.prototype.propertyIsEnumerable()
Object.prototype.toLocaleString()
Object.prototype.toSource()
Object.prototype.toString()
Object.prototype.valueOf()
Object.setPrototypeOf()