gpt4 book ai didi

javascript - 在 ES6 导入中重写 require ('shipit-deploy' )(shipit) 之类的东西?

转载 作者:行者123 更新时间:2023-11-30 11:51:44 25 4
gpt4 key购买 nike

我正在尝试寻找以下 es6 形式的示例:

require('shipit-deploy')(shipit)

我通常会选择类似的东西

导入 'shipit-deploy'

但是在这种情况下,require 末尾有 (shipit),我不确定如何正确导入。

最佳答案

require('shipit-deploy')(shipit) 首先需要指定的模块,然后使用 shipit 作为参数调用结果。您可以通过首先将 'shipit-deploy' 导入某个变量,然后使用 shipit 作为参数调用结果来获得相同的结果。

import shipitDeployImport from 'shipit-deploy'
const shipitDeploy = shipitDeployImport(shipit)

关于javascript - 在 ES6 导入中重写 require ('shipit-deploy' )(shipit) 之类的东西?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39245303/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com