This repository was archived by the owner on Dec 31, 2024. It is now read-only.
Type definition: wrong parameter types #749
Labels
Type: Improvement
Includes backwards-compatible fixes
vue & vue-i18n version
Vue version 2.6.1, Vue-i18n version 8.15.1
Reproduction Link
https://jsfiddle.net/8svpywbg/2/
Steps to reproduce
Write
this.$d(123456, { useGrouping: false });
.What is Expected?
From the documentation it looks like that when calling VueI18n's
this.$n(number, key)
, one could also use an object as the parameterkey
. This object should be similar to (if not just being to an instance of)Intl.NumberFormat
.What is actually happening?
However, in
Intl.NumberFormat
,useGrouping
's type isboolean
, meanwhilethis.$n()
will only accept it if it's astring
:vue-i18n/types/index.d.ts
Line 182 in fc110cd
If someone write
this.$n(number, { useGrouping: false })
, typescript will give the following error:The text was updated successfully, but these errors were encountered: