gpt4 book ai didi

path - Aurelia 构成 View 模型路径

转载 作者:行者123 更新时间:2023-12-02 04:38:56 28 4
gpt4 key购买 nike

我的组件具有动态部分和 compose。动态部分在其他模块中,即节点项目。

如果我想在页面中使用自定义元素,例如:
<my-custom-element body.bind="someVariableContainingThePath"></my-custom-element>

我收到一条错误消息,指出无法在 ./my-custom-element/someVariableContainingThePath 中找到在 someVariableContainingThePath 中指定的 View 模型。

在使用 compose 元素时推荐的路径处理方式是什么。

我正在使用 webpack。

有没有办法给模块起别名。

所以可以设置someVariableContainingThePath='moduleA'然后指定那个 moduleA =/some/path/my-body-custom-element ?

最佳答案

对于 webpack 捆绑,你必须给它一个提示。否则您的 View 将不会被捆绑。您可以在配置 aurelia 时将您的组件添加到 globalResourses http://aurelia.io/docs/fundamentals/app-configuration-and-startup#making-resources-global

您必须使用 PLATFORM.modulename 装饰您的模块名称,如 .globalResources(PLATFORM.modulename('my-module'))

关于path - Aurelia 构成 View 模型路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39079174/

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