1.10.3 • Published 6 years ago
bemjson-to-jsx v1.10.3
bemjson-to-jsx
Transforms BEMJSON objects to JSX markup.
Install
$ npm install --save bemjson-to-jsx
Usage
const bemjsonToJSX = require('bemjson-to-jsx')();
var bemjson = {
block: 'button2',
mods: { theme: 'normal', size: 'm' },
text: 'hello world'
};
var jsxTree = bemjsonToJSX.process(bemjson);
console.log(jsxTree.JSX);
// → "<Button2 theme={'normal'} size={'m'} text={'hello world'}/>"
Options
isNameSpacedElems
isNameSpacedElems
Change generation of JSX Class
true
— Block.Elemfalse
— BlockElem ( default )
const bemjsonToJSX = require('bemjson-to-jsx')({ isNameSpacedElems: true });
var bemjson = {
block: 'button2',
elem: 'text'
text: 'hello world'
};
var jsxTree = bemjsonToJSX.process(bemjson);
console.log(jsxTree.JSX);
// → "<Button2.Text text={'hello world'}/>"
1.10.3
6 years ago
1.10.2
6 years ago
1.10.1
6 years ago
1.10.0
6 years ago
1.9.1
6 years ago
1.9.0
6 years ago
1.8.3
6 years ago
1.8.2
6 years ago
1.8.1
6 years ago
1.8.0
7 years ago
1.7.1
7 years ago
1.7.0
7 years ago
1.6.1
7 years ago
1.6.0
7 years ago
1.5.0
7 years ago
1.4.0
7 years ago
1.3.0
7 years ago
1.2.0
7 years ago
1.1.0
7 years ago
1.0.0
7 years ago
0.2.0
7 years ago
0.1.1
7 years ago
0.1.0
7 years ago
0.0.1
7 years ago
0.0.0
7 years ago