我想要一个标签的自定义标签,让我可以编写以下代码
app-tabset#my-tab
@tab title="first"
p -- content of first tab
@tab title="second"
p -- content of second tab
但我不能让它消耗重复的属性,因此在app-tabset.marko
onMount() {
console.log('incoming tabs', this.input.tab)
// expected an array but only object of second tab
// "{title="second", renderBody: function}"
}
在重复的属性标签中阅读文档我添加了一个marko-tag.json
{
"<tab>": {
"is-repeated": true
}
}
这编译得很好但是在加载页面时我得到
Render async fragment error (lasso-slot:head).
Exception: Error: Unable to load tag ([C:\projects\marko\src\components → C:\projects\marko\src\components\app-tabset\marko-tag.json]):
Error: Error while applying option of "<tab>".
Cause: Error: Unsupported properties of [is-repeated]