Package Exports
- rml
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (rml) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
rml
React Markup Language. An alternate markup language to react jsx. inspired by wxml.
preview
http://yiminghe.github.io/rml/examples/playground.html
<div r:for="{{items}}" r:key="key">
<div r:if="{{item.value > 1}}" onClick="{{this.onClick}}">
{{item.value}} more than one
</div>
</div>webpack-loader
https://github.com/yiminghe/rml-loader
syntax
for details checkout: https://github.com/yiminghe/rml/blob/master/tests/specs
data binding
{{x}}loop
<tag r:for="{{items}}" r:key="key" r:for-item="item" r:for-index="index">
{{item.value}} at {{index}}
</tag>condition
<tag r:if="{{x>3}}">
</tag>
<tag r:elif="{{x>2}}">
</tag>
<tag r:else="{{x>1}}">
</tag>block
will render no actual jsx
<block r:if="{{x>1}}">
<tag />
</block>template
<template name="t">
<div>{{z}}</div> <!-- from data attribute-->
</template>
<div>
<template is="{{x%2 ? 't' : 'z'}}" data="{{...o}}" />
</div>import
<import src="./a.rml" /> <!-- will define template t and z-->
<div>
<template is="{{x%2 ? 't' : 'z'}}" data="{{...o}}" />
</div>include
<div>
<include src="./a.rml" /> <!-- embed-->
</div>import-module, need to activate allowImportModule flag, defaults to false.
<import-module name="{View, Text}" from="react-native" />
<View><Text>Hello, rml</Text></View>Development
npm starthttp://localhost:8011/examples/playground.html
Test Case
npm test
npm run coverageLicense
rml is released under the MIT license.