1
0
mirror of https://github.com/bobwen-dev/react-templates synced 2025-04-12 00:56:39 +02:00
react-templates/test/data/virtual.rt.js
nino-porcino 46caeea387 Fix #138, #139, #134, #144, #145, #147, #157, #158, #161, #162 (#142)
* Single child for rt-template (fixes #138)

* Nested scope functions (fixes #139)

* Forbid nested rt-import (fixes #134)

* Vendor prefixes style keys (#144)

* Renamed test file

* Forbid expressions in style keys (#145)

* fixed rt-import and AMD (#147)

* Updated documentation

* Fixed links in README.md

* Sanitize comments (fix #158)

* Disable comments when es6 (fix#157)

* Added test case for comments

* Simplified TypeScript output

* Test cases for simplified TypeScript output

* Fixed wrong TypeScript output (#161)

* fix repeat with custom index (#162)
2016-07-06 11:25:08 +03:00

27 lines
872 B
JavaScript

define([
'react',
'lodash'
], function (React, _) {
'use strict';
return function () {
function repeatN1(verb, n, nIndex) {
return [
React.createElement('div', { 'key': '2211' }, verb, ' ', n, '-a'),
React.createElement('div', { 'key': '2213' }, verb, ' ', n, '-b')
];
}
function scopeVerb2() {
var verb = 'rendered';
return [
1 < 0 ? [React.createElement('div', { 'key': '551' }, 'this is not ', verb)] : null,
1 > 0 ? [React.createElement('div', { 'key': '1401' }, 'this is ', verb)] : null,
_.map([
1,
2
], repeatN1.bind(this, verb))
];
}
return React.createElement('div', {}, scopeVerb2.apply(this, []));
};
});