• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript exports.renderer_render函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了TypeScript中@core/renderer/exports.renderer_render函数的典型用法代码示例。如果您正苦于以下问题:TypeScript renderer_render函数的具体用法?TypeScript renderer_render怎么用?TypeScript renderer_render使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了renderer_render函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。

示例1: function

	'expressions': function(){
		var dom = renderer_render('"~[a] ~[: b[\'sub\'] ]"', {
			a: 'A',
			b: { sub: 'Sub!'}
		});
		eq_(dom.textContent, 'A Sub!');
	},
开发者ID:atmajs,项目名称:MaskJS,代码行数:7,代码来源:render.spec.ts


示例2: function

			domLib.fn[method] = function(template, model, ctr, ctx){
				if (this.length === 0) {
					//#if (DEBUG)
					log_warn('<jcompo> $.', method, '- no element was selected(found)');
					//#endif
					return this;
				}
				if (this.length > 1) {
					//#if (DEBUG)
					log_warn('<jcompo> $.', method, ' can insert only to one element. Fix is comming ...');
					//#endif
				}
				if (ctr == null) {
					ctr = index < 2
						? this.compo()
						: this.parent().compo()
						;
				}
				
				var isUnsafe = false;
				if (ctr == null) {
					ctr = {};
					isUnsafe = true;
				}
				
				
				if (ctr.components == null) {
					ctr.components = [];
				}
				
				var compos = ctr.components,
					i = compos.length,
					fragment = renderer_render(template, model, ctx, null, ctr);
				
				var self = this[jQ_Methods[index]](fragment),
					imax = compos.length;
				
				for (; i < imax; i++) {
					CompoSignals.signal.emitIn(compos[i], 'domInsert');
				}
				
				if (isUnsafe && imax !== 0) {
					// if DEBUG
					log_warn(
						'$.'
						, method
						, '- parent controller was not found in Elements DOM.'
						, 'This can lead to memory leaks.'
					);
					log_warn(
						'Specify the controller directly, via $.'
						, method
						, '(template[, model, controller, ctx])'
					);
					// endif
				}
				
				return self;
			};
开发者ID:atmajs,项目名称:MaskJS,代码行数:59,代码来源:jCompo.ts


示例3: renderer_render

		]).forEach(function(row){
			expect = row.expect;
			expect.unshift('Mask::Log');
			
			renderer_render(
				row.data[0], row.data[1], null, null, row[3]
			);
		})
开发者ID:atmajs,项目名称:MaskJS,代码行数:8,代码来源:debug.spec.ts


示例4: eval

			.pipe(pckg => {
				eval(pckg.script);
				$('<style>').text(pckg.style).appendTo('body');
				var dom = renderer_render(pckg.mask);
				return UTest.domtest(dom, `
					find ('.foo') {
						text Foo;
					}
				`)
				
			});
开发者ID:atmajs,项目名称:MaskJS,代码行数:11,代码来源:build.spec.ts


示例5: customTag_define

	},
	'should load async javascripts scope' (done) {
		customTag_define('TestAsync', Compo.create({
			onRenderStart () {
				var x = this.$scope('X');
				eq_(x, null, 'Scope should be empty, while still loading');

				setTimeout(() => {
					x = this.$scope('X');
					has_(x, { foo: { name: 'Foo1' }});
					done();
				}, 300);
			}
		}));
		renderer_render(`
			import async * as X from '/test/tmpl/modules/data_foo_1.js';
			TestAsync;
		`);
	},
	'should await the component': {
		'simple await' (done) {
			customTag_define('TestAsync', Compo({
				onRenderStart () {
					var x = this.$scope('X');
					has_(x, { foo: { name: 'Foo2' }});
					done();
				}
			}));
			renderer_render(`
				import async * as X from '/test/tmpl/modules/data_foo_2.js';
				await (X) > TestAsync;
			`);
开发者ID:atmajs,项目名称:MaskJS,代码行数:32,代码来源:async.spec.ts


示例6: UTest

import { customTag_define } from '@core/custom/tag';
import { renderer_render } from '@core/renderer/exports';
import { Compo } from '@compo/exports';

declare var sinon;

UTest({
    'should set elements property' () {

        let div = renderer_render(`
            div 
                [style.position] = relative
                [style.borderTopWidth] = 2em
            ;
        `);
        eq_(div.style.position, 'relative');
        eq_(div.style.borderTopWidth, '2em');        
    },
    'should set components properties' () {
        let fn = sinon.spy(function(model){
            eq_(this.a.b.c, 'd');
        });
        customTag_define('Foo', Compo({
            onRenderStart: fn
        }))

        renderer_render('Foo [a.b.c] = d');
        eq_(fn.callCount, 1);
    }
});
开发者ID:atmajs,项目名称:MaskJS,代码行数:30,代码来源:properties.spec.ts


示例7: if

					template: mix
				}]));
			}
		}
		else if (typeof mix === 'function') {
			createNode(mix);
		}

		if (parent == null && container != null) {
			parent = Anchor.resolveCompo(container);
		}
		if (parent == null){
			parent = new Component();
		}

		var dom = renderer_render(node, model, ctx, null, parent),
			instance = parent.components[parent.components.length - 1];

		if (container != null){
			container.appendChild(dom);
			CompoSignals.signal.emitIn(instance, 'domInsert');
		}

		return instance;
	},



    find: compo_find,
	findAll: compo_findAll,
	closest: compo_closest,
开发者ID:atmajs,项目名称:MaskJS,代码行数:31,代码来源:CompoStatics.ts


示例8: deepEq_

			deepEq_(node.extends,  [
				{ compo: 'a' },
				{ compo: 'b' },
				{ compo: 'c.y.z' },
			]);
		}
	},
	'should pass arguments as a model': {
		'single' () {
			var template = `
				define Foo (user) {
					h4 > '~user.name'
				}
				Foo (me);
			`
			var dom = renderer_render(template, { me: { name: 'TestUser' }});
			return UTest.domtest(dom, `
				find (h4) > text TestUser;
			`)
		},
		'multiple' () {
			var template = `
				define Foo (user, friend) {
					h3 > '~user.name'
					h4 > '~friend.name'
				}
				Foo (me, me);
			`
			var dom = renderer_render(template, { me: { name: 'TestUser' }});
			return UTest.domtest(dom, `
				find (h3) > text TestUser;
开发者ID:atmajs,项目名称:MaskJS,代码行数:31,代码来源:define.spec.ts



注:本文中的@core/renderer/exports.renderer_render函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript exports.renderer_renderAsync函数代码示例发布时间:2022-05-28
下一篇:
TypeScript delegate.CoreQuestionDelegate类代码示例发布时间:2022-05-28
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap