Why riot-typed
Write riotjs tags in a more oo-way with benefits of typescript
How to use
install
support typescript@2.4.2.
npm install -g typescriptnpm install -g typings
npm install --save-dev riot-typed
install riot typed definitions
typings install -DG github:Joylei/riot-typed/src/riot.d.ts#2ca54b484694b133cbe6f58347242f6a1e273e17
install riot-typed typed definitions
typings install -DG github:Joylei/riot-typed/src/riot-typed.d.ts#2ca54b484694b133cbe6f58347242f6a1e273e17
usage
let's define a tag
//file: tags/app.ts;
let's mount the tag
//file: main.ts;riot.mount'app';
override
It's possible to override definition properties: tmpl|attrs|css.
//file: logger.ts;
override css definition only:
//file: error-logger.ts
examples
please see examples for more information.
tag() decorator
tag(tagName: string, tmpl?: string | { tmpl?: string, css?: string, attrs?: string })
restrictions
please see riot.tag() for restrictions.
License
MIT