@rebelcode/vc-repeater v0.1.0
Repeater Component
Usage
<repeater :collection="items">
<div class="repeater-item" slot-scope="r">
<span>{{ r.item.title }}</span>
<button @click="r.remove(r.item)">x</button>
</div>
</repeater>Where collection has type of FunctionalCollection from std-lib.
This example will iterate through all items in collection object and output each item using child repeater code (<div slot-scope="r"... in our case). Next options is available in item's code:
{scopeName}is string you've passed toslot-scopeattribute inside item's template. In our example isr. In that template you'll be able to access to exposed methods and variables using that scope.
{scopeName}.remove(item) - function for removing item from the collection. Usefull when you want to add controls to your items (like x button for removing).
{scopeName}.item - item that we iterating on from our collection.
Developing
Run npm install to install all dev dependencies.
Here is available npm commands.
Build library while developing
npm run devBuild library for production
npm run productionRun e2e tests
npm run e2e8 years ago