How to use the tmpl/2.1.x/ function in tmpl

To help you get started, we’ve selected a few tmpl examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github heeroluo / jraiser / calendar / 1.1.x / index-debug.js View on Github external
define(function(require, exports, module) { 'use strict';

/**
 * 月历组件
 * @module calendar/1.1.x/
 * @category Widget
 */

var base = require('base/1.1.x/'),
	$ = require('dom/1.1.x/'),
	Tmpl = require('tmpl/2.1.x/'),
	widget = require('widget/1.1.x/');


var tmpl = new Tmpl({
	table:
'>' +
'<% if (weekDayNames) { %>' +
	'' +
		'' +
	'<% weekDayNames.forEach(function(name) { %>' +
			'' +
	'<% }); %>' +
		'' +
	'' +
'<% } %>' +
	'' +
'<% weeks.forEach(function(week) { %>' +
		'' +<table class="ui-calendar"><thead class="ui-calendar__head"><tr><th class="ui-calendar__head__grid">' +
				'<span class="ui-calendar__head__grid__inner">&lt;%=name%&gt;</span>' +
			'</th></tr></thead><tbody class="ui-calendar__body"><tr></tr></tbody></table>
github heeroluo / jraiser / selectmenu / 1.1.x / index-debug.js View on Github external
define(function(require, exports, module) { 'use strict';

/**
 * 模拟选择框组件
 * @module selectmenu/1.1.x/
 * @category Widget
 */

var widget = require('widget/1.1.x/'),
	Tmpl = require('tmpl/2.1.x/'),
	$ = require('dom/1.1.x/'),
	Scrollbar = require('scrollbar/1.1.x/');


var tmpl = new Tmpl({
	SELECTMENU:
'<div class="ui-selectmenu">' +
	'<div class="ui-selectmenu__button">' +
		'<span class="ui-selectmenu__button__text">&lt;%=defaultText%&gt;</span>' +
		'<span class="ui-selectmenu__button__icon"></span>' +
	'</div>' +
	' name="&lt;%=name%&gt;"&lt;% } %&gt; type="hidden" /&gt;' +
	'<div style="display: none;" class="ui-selectmenu__layer">' +
		'<div class="ui-selectmenu__layer__inner">' +
			'<ul class="ui-selectmenu__menu"></ul>' +
		'</div>' +
	'</div>' +
'</div>',

	MENU_ITEMS:
'&lt;% data.forEach(function(d) { %&gt;' +

tmpl

JavaScript micro templates.

BSD-3-Clause
Latest version published 3 years ago

Package Health Score

65 / 100
Full package analysis