我在 IntelliJ IDEA 中使用 ES6。下面是一段代码。
import controller from './tpmInfo.ctrl.js'
import template from './tpmInfo.tpl.html' //default export is not declared in imported module
export default angular.module('tmpApp', [])
.component('tpmInfo', {
template: template,
controller: controller,
bindings: {
ags: '='
}
})
.name;
template
html 是一个普通的 html,但 IntelliJ IDEA 会抛出警告“默认导出未在导入的模块中声明”。有没有办法让这个警告消失?谢谢。
最佳答案
试试这个:
import * as tpl from './tpmInfo.tpl.html'
然后像这样使用它:
template: tpl.template,
让我知道这是否适合您。
关于angularjs - 默认导出未在导入模块中声明,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38509351/