我在应用程序中使用strong-soap包。在将require()转换为import语句时,我面临以下语法问题。
var soap = require('strong-soap').soap;
to
import soap from 'strong-soap.soap' // doesn't work also throwing syntax error
import soap from 'strong-soap';//not working as expected
感谢您的帮助
答案 0 :(得分:6)
soap是strong-soap
的对象,因此以下内容可行 - ES6模块导入。
import { soap } from 'strong-soap';