建议使用第一种 import
年份 | 出处 | |
---|---|---|
import/export | 2015 | ECMAScript2015(ES6) |
require/exports | 2009 | CommonJS |
1、import
import StatusEnum from '../../../utils/status_enum';
export default class StatusEnum {
static statusMapWalletTranslation: Record<string, string> = {
"1": "成功",
"2": "失败",
};
}
2、require
const StatusEnum = require('../../../utils/status_enum');
class StatusEnum {
static statusMapWalletTranslation: Record<string, string> = {
"1": "成功",
"2": "失败",
};
}
module.exports = StatusEnum;