【发布时间】:2022-01-01 01:44:47
【问题描述】:
我正在尝试在组件内设置组件的动态id。
所以子组件有一个可绑定的uniqueId 属性。
父组件有自己的uniqueId,我试图将其保留在子组件的uniqueId 中,如下BEM 约定:
<text-input-editor repeat.for="boxSide of boxSides"
uniqueId.bind="box-editor-${uniqueId}__${boxSide}-input"></text-input-editor>
但这给了我以下错误:unconsumed token {(删节)。
我尝试在https://aurelia.io/docs/templating/custom-elements#declarative-computed-values 中使用<let></let> 元素,但这也不起作用。
我不确定如何在视图中执行此操作,因为我宁愿不在控制器级别处理此问题(这只是该视图中的众多组件之一)。
【问题讨论】:
标签: aurelia aurelia-templating