我想创建一个组件,该组件将使用可配置的nodesListItem
和nodesList
呈现任何类型的列表。
是否有众所周知的做法?我可以这样做吗?我可以使用渲染功能吗?谢谢。
列表视图
div
// render entries-list component
slot(name="nodesList")
// render entries-list-item component as slot of entries-list
template(v-slot)
template(v-for="...")
slot(name="nodesListItem")
条目列表
ul.rectangle-card-wrapper.v3-gallery-card-classes.list-unstyled
slot
父母
list-view
template(v-slot:nodesListItem="{ entry, active }")
entries-list-item(
:title="entry.name"
:path="entry.path"
)
template(v-slot:nodesList)
entries-list