我有一个导出常量的文件。
export const PASSWORD_MISMATCH_ERROR = 'Passwords not match!';
export const USER_NOT_FOUND_ERROR = 'User not found';
export const WRONG_PASSWORD_ERROR = 'The password is incorrect';
export const UNAUTHORIZED = 'User unauthorized';
我该怎么做才能不必分别导出每个常量?
最佳答案
ECMAScript 262 specification allows this trivially :
export const
PASSWORD_MISMATCH_ERROR = 'Passwords not match!',
USER_NOT_FOUND_ERROR = 'User not found',
WRONG_PASSWORD_ERROR = 'The password is incorrect',
UNAUTHORIZED = 'User unauthorized';
关于javascript - 如何一次导出所有常量?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/74191345/