0

我想要一个标签的自定义标签,让我可以编写以下代码

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]
4

1 回答 1

0

如果您还没有找到解决方案,请在您的 marko-tag.json 文件中尝试此操作

{
    "@tabs <tab>[]": {
        "@title": "string"
    }
}
于 2019-09-09T07:35:39.693 回答