Intl.NumberFormat.prototype.formatToParts 从 13 开始支持 Safari 旧版本
Intl.NumberFormat.prototype.formatToParts support for Safari older version from 13
我在我的应用程序中遇到一个错误,即 **formaTtoParts**
未定义
TypeError: Intl.NumberFormat(t,{minimumFractionDigits:2}).formatToParts is not a
function. (In 'Intl.NumberFormat(t,{minimumFractionDigits:2}).formatToParts(ri(e))',
'Intl.NumberFormat(t,{minimumFractionDigits:2}).formatToParts' is undefined)
browser.name:
Mobile Safari UI/WKWebView
device:
iPhone
interface_type:
exception
os:
iOS 12.5.5
是否可以找到一个 polyfill,用于支持 13 之前版本的 Safar 的替代解决方案???
https://formatjs.io/docs/react-intl/components#formattednumberparts
React Intl has a set of React components that provide a declarative way to
setup an i18n context and format dates, numbers, and strings for display in
a web UI. The components render React elements by building on React Intl's imperative API.
当Intl.NumberFormat.prototype.formatToParts
不支持
时,这可能对我们在设备上有所帮助
以下是用于检查更多实施细节的文件:
FormatNumericToParts.ts
此外,也可以使用 @formatjs
作为 polyfill
import '@formatjs/intl-numberformat/polyfill'
import '@formatjs/intl-numberformat/locale-data/en' // locale-data for en
我在我的应用程序中遇到一个错误,即 **formaTtoParts**
未定义
TypeError: Intl.NumberFormat(t,{minimumFractionDigits:2}).formatToParts is not a
function. (In 'Intl.NumberFormat(t,{minimumFractionDigits:2}).formatToParts(ri(e))',
'Intl.NumberFormat(t,{minimumFractionDigits:2}).formatToParts' is undefined)
browser.name:
Mobile Safari UI/WKWebView
device:
iPhone
interface_type:
exception
os:
iOS 12.5.5
是否可以找到一个 polyfill,用于支持 13 之前版本的 Safar 的替代解决方案???
https://formatjs.io/docs/react-intl/components#formattednumberparts
React Intl has a set of React components that provide a declarative way to
setup an i18n context and format dates, numbers, and strings for display in
a web UI. The components render React elements by building on React Intl's imperative API.
当Intl.NumberFormat.prototype.formatToParts
不支持
以下是用于检查更多实施细节的文件: FormatNumericToParts.ts
此外,也可以使用 @formatjs
作为 polyfill
import '@formatjs/intl-numberformat/polyfill'
import '@formatjs/intl-numberformat/locale-data/en' // locale-data for en