【发布时间】:2016-12-28 23:36:35
【问题描述】:
我的组件包含带有 compose 的动态部分。动态部分位于其他模块中,即节点项目。
如果我想在页面中使用自定义元素,例如:
<my-custom-element body.bind="someVariableContainingThePath"></my-custom-element>
我收到一条错误消息,指出在 ./my-custom-element/someVariableContainingThePath 中找不到在 someVariableContainingThePath 中指定的视图模型。
在使用 compose 元素时,推荐的路径处理方式是什么。
我正在使用 webpack。
有没有办法给模块起别名。
所以可以设置 someVariableContainingThePath='moduleA' 然后指定 那个 moduleA = /some/path/my-body-custom-element ?
【问题讨论】: