Vivio
A DSL alternative for JSX.
Why?
Because I want type safety in Vue's template and tsx does not support Vue compatible format. Period.
Example
Should be self explanatory.
// component definition h // register components.div`.el-autocomponet` // staticClass in tagged template .elInput // component .propss.extract'value', 'disabled', 'placeholder', 'name', 'size' // pass props by special method .on // the same for event .nativeOn .elInput // close tag .transition.props .ul.ifs.suggestionVisible .li.ifs.loading .i`.el-icon-loading`.i .li .fors.suggestions,h .li .on .class .span.if!s.customIndex .$`Name: ` // interpolate text via $`statictext` .span .tags.customIndex.else // dynamic tag mounting .class .on .props .tag .li .ul .transition.div
Should I use it in ....?
No. The API design and implemenation is too experimental and heretic. It might even harm your feeling when making a new toy.
TODO
- for
- $
- tag
- children
- scoped template