我对Angular中已经内置的CurrencyPipe有问题.
我需要使用CurrencyPipe显示货币符号,但除非我提供输入数字,否则我无法使用它.
因为CurrencyPipe使用当前的区域设置来获取货币符号,所以我认为输入的数字可以是可选的.
目前的行为:
{{ 1 | currency:'USD' }} --> $1
Run Code Online (Sandbox Code Playgroud)
需要的行为:
{{ null | currency:'USD' }} --> $
Run Code Online (Sandbox Code Playgroud)
你们是否知道默认管道是否可行?谢谢!!
我正在为Async Select from苦苦挣扎react-select。我设法显示了一些 defaultOptions 并使用 promises 和loadOptionsprop对其选项进行异步获取。
我需要的是在单击时显示选项下拉列表时更新选项(解决承诺)。有没有办法执行相同的承诺onClick(即使在onChange)?
我正在使用react-select团队提供的以下代码笔https://codesandbox.io/s/7w4w9yyrmx?module=/example.js
感谢您的帮助!