Getting TypeError: numeral_1.default is not a function in value converter
Getting TypeError: numeral_1.default is not a function in value converter
我已经通过 npm 安装了 numeral.js
并在 vendors bundle 中添加了 aurelia.json
,然后我从值转换器中使用它:
import numeral from 'numeral';
export class CurrencyValueConverter {
toView(value) {
return numeral(value).format('[=10=],0.00')
}
}
我收到以下错误TypeError: numeral_1.default is not a function
尝试import * as numeral from 'numeral'
我已经通过 npm 安装了 numeral.js
并在 vendors bundle 中添加了 aurelia.json
,然后我从值转换器中使用它:
import numeral from 'numeral';
export class CurrencyValueConverter {
toView(value) {
return numeral(value).format('[=10=],0.00')
}
}
我收到以下错误TypeError: numeral_1.default is not a function
尝试import * as numeral from 'numeral'