我想知道是否可以将重复父索引重复传递给转换器?
我试过这个:
<div repeat.for="row of router.navigation | myFilter:1:$parent.$index">
但它不起作用!
有什么想法吗?
任何解决方法?
最佳答案
有可能 - 您上面的代码应该可以工作。这是一个运行示例:https://gist.run?id=5df404d80be769a0d62aab2f7c9f300e
app.html
<template>
<require from="./test-converter"></require>
<div repeat.for="y of 3">
<span repeat.for="x of 3">${ x * y | test : $index : $parent.$index }</span>
</div>
</template>
app.js
export class App {
message = 'Hello World!';
}
test-converter.js
export class TestValueConverter {
toView(value, x, y) {
return `(${x},${y},${value})`;
}
}
关于javascript - 如何引用 aurelia 中的重复父索引?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36312414/