msforest / notebook

好记性不如烂笔头,记录知识的点点滴滴。
https://github.com/msforest/notebook/wiki
0 stars 0 forks source link

react-intl 单复数转换 #41

Open msforest opened 2 years ago

msforest commented 2 years ago

参考: https://codesandbox.io/s/o56w8ywwoz?file=/src/App.js:108-122

"test": "{count, plural, =0 {no items} one {# item} other {# items}}"

intl.formatMessage({ id: "test" }, { count: 1 }) => 1 item

intl.formatMessage({ id: "test" }, { count: 0 }) => no items

intl.formatMessage({ id: "test" }, { count: 2 }) => 2 items

msforest commented 2 years ago

https://github.com/formatjs/formatjs/issues/868

msforest commented 2 years ago

面试相关 https://vue3js.cn/interview/webpack/Loader_Plugin.html#%E4%B8%89%E3%80%81%E7%BC%96%E5%86%99plugin