Intl.ListFormat for Vue 3 · English
Frank, Christine, Flora, and Harrison
Pass an array, get a sentence. The separators, the and and the or come from the browser's own locale data — no dictionaries to ship.
pnpm add v-intl-listformatpayload · 4/8
- Frank
- Christine
- Flora
- Harrison
presets
<VIntlListFormat :payload="['Frank','Christine','Flora','Harrison']" />One list, 13 locales
The same payload, type and style rendered by the component in every locale the playground offers.
- en · EnglishFrank, Christine, Flora, and Harrison
- de · DeutschFrank, Christine, Flora und Harrison
- fr · françaisFrank, Christine, Flora et Harrison
- es · españolFrank, Christine, Flora y Harrison
- pt-BR · português (Brasil)Frank, Christine, Flora e Harrison
- hi · हिन्दीFrank, Christine, Flora, और Harrison
- mr · मराठीFrank, Christine, Flora आणि Harrison
- ja · 日本語Frank、Christine、Flora、Harrison
- zh · 中文Frank、Christine、Flora和Harrison
- ko · 한국어Frank, Christine, Flora 및 Harrison
- ar · العربيةFrank وChristine وFlora وHarrison
- ru · русскийFrank, Christine, Flora и Harrison
- sw · KiswahiliFrank, Christine, Flora na Harrison
Props
The defaults match Intl.ListFormat. A formatList() helper is exported for use outside templates.
- payload
The items to join.
string[] · default required
- locale
BCP 47 locale tag, for example de or ja.
string · default 'en'
- list-type
and · or · no word.
'conjunction' | 'disjunction' | 'unit' · default 'conjunction'
- list-style
How short the separators get.
'long' | 'short' | 'narrow' · default 'long'