0.0.2 • Published 8 years ago

knockout.slot v0.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

knockout.slot

Knockout components are very similar to Custom Elements, which are part of Web Components Spec.This plugin implement the very basic Slot API.

Usage

Install from NPM:

npm install knockout.filter --save
<script src="knockout.3.4.0.js"></script>
<script src="./node_modules/knockout.fitler/dest/knockout.slot.js"></script>

Example

son.tpl

<div class="son">
    <slot name="a">old</slot>
</div>

parent.tpl

<div class="parent">
    <son>
        <slot name="a">new</slot>
    </son>
</div>

yield:

<div class="parent">
    <son>new</son>
</div>

License

MIT © BinRui.Guan(mailto: differui@gmail.com)