【发布时间】:2016-11-12 14:03:06
【问题描述】:
有没有反正不写这个:
import {replace_in_mtstr, tot_width, rationalize, eval_expression, ascii_to_latex, latex_to_ascii, getIndicesOf, cleanIndices, change_sign, exponentiate, multiply_grouped_nodes, flip_fraction, add_brackets, are_of_type, any_of_type, have_same_ancestors, have_same_type, have_same_text, have_single_factor, have_same_denom, are_same_terms, get_prev, get_next, get_all_next, has_op, parse_mtstr, parse_poly, prepare} from "./functions";
在 ES6 中?这些都是不同文件中的所有导出函数。我知道的关闭是import * as object from 'file';。但是,我希望这些函数直接可用,而不是在对象内部。这在 ES6 中可行吗?
【问题讨论】:
-
不可能……另请参阅here 以及那里链接的问题。
-
不可能。您可以执行
import functions from "./functions";并从functions对象访问所有这些导出的函数。 -
好的,然后:P。谢谢你告诉我。
标签: import ecmascript-6