将相同的导入到一个柏树文件上
我们使用的是柏树v10和我们的 .cy.js 文件始终使用以下相同的导入:
import Customers from "../imports/Customer"
import Search from "../imports/Search"
import PostComment from "../imports/PostComment"
import Feedback from "../imports/Feedback"
import Login from "../imports/Login"
有更好的方法可以将所有这些导入包含在一到两行中,并且不会手动称其为?我尝试创建一个complete.js
包含复制粘贴代码的文件,然后尝试导入完整的js,但似乎不起作用。我不确定我是否缺少任何东西。
We are using Cypress v10 and our .cy.js files always use these same imports:
import Customers from "../imports/Customer"
import Search from "../imports/Search"
import PostComment from "../imports/PostComment"
import Feedback from "../imports/Feedback"
import Login from "../imports/Login"
Is there a better way that I can include all these imports in a single or two lines and not call them manually like this? I tried creating a complete.js
file that contains copy pasted code as above then try to import that complete.js but it does not seem to work. I'm not sure if I'm missing anything.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用索引文件重新出口并简化导入。
You can use an index file to re-export and simplify the import.
将单个文件中的默认转换为
命名
在枪管索引中的导出To convert
default
exports in the individual files tonamed
exports in the barrel index