聚合物中模板结合的是什么? [英] What is template-bound in polymer?

查看:78
本文介绍了聚合物中模板结合的是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现在搜索聚合物文档无法找到那是什么后,firebase聚合物firebase-login.html中有一个模板绑定.

I noticed there is a template-bound in firebase polymer firebase-login.html after searching polymer documentation cannot find out what is that.

还可以参考文档中的任何聚合物事件吗?

also, any polymer events reference in documentation?

推荐答案

这是在聚合物的自动绑定模板中发生数据绑定后触发的事件.

This is the event that fires after the data binding happens in a Polymer's auto-binding template.

<template id="myTemplate" is="auto-binding">
</template>
<script>
    var template = document.getElementById("myTemplate");
    template.addEventListener('template-bound', function() {
        console.log('ready');
    });
</script>

自动绑定模板会立即插入其创建的实例 在DOM树中(而不是在其影子DOM中).

The auto-binding template inserts the instances it creates immediately after itself in the DOM tree (not in its shadow DOM).

添加实例后,自动绑定模板将触发 模板绑定事件.

After adding the instances, the auto-binding template fires the template-bound event.

您可以从此处了解更多信息.

You can read more from here.

这篇关于聚合物中模板结合的是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆