惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
美团技术团队
腾讯CDC
V
V2EX
G
Google Developers Blog
博客园 - Franky
博客园 - 司徒正美
Stack Overflow Blog
Stack Overflow Blog
阮一峰的网络日志
阮一峰的网络日志
Microsoft Azure Blog
Microsoft Azure Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
T
The Blog of Author Tim Ferriss
Recent Announcements
Recent Announcements
Google DeepMind News
Google DeepMind News
罗磊的独立博客
C
Check Point Blog
MyScale Blog
MyScale Blog
aimingoo的专栏
aimingoo的专栏
F
Fortinet All Blogs
酷 壳 – CoolShell
酷 壳 – CoolShell
V2EX - 技术
V2EX - 技术
The Last Watchdog
The Last Watchdog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
有赞技术团队
有赞技术团队
Security Archives - TechRepublic
Security Archives - TechRepublic
S
Security @ Cisco Blogs
W
WeLiveSecurity
D
DataBreaches.Net
Forbes - Security
Forbes - Security
V
Visual Studio Blog
P
Proofpoint News Feed
S
Secure Thoughts
H
Help Net Security
Cloudbric
Cloudbric
云风的 BLOG
云风的 BLOG
Microsoft Security Blog
Microsoft Security Blog
N
News and Events Feed by Topic
Schneier on Security
Schneier on Security
Engineering at Meta
Engineering at Meta
Attack and Defense Labs
Attack and Defense Labs
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
S
Security Affairs
L
LangChain Blog
Last Week in AI
Last Week in AI
Martin Fowler
Martin Fowler
Hacker News: Ask HN
Hacker News: Ask HN
H
Heimdal Security Blog
M
MIT News - Artificial intelligence
The Register - Security
The Register - Security

Polymer

About Polymer 2.0 - V2EX 父节点竟然是 Google,不应该是前端吗? - V2EX
如何将 Polymer 组件中的函数用在模板中? - V2EX
iugo · 2016-05-16 · via Polymer

iugo

V2EX  ›  Polymer

 

iugo · 2016 年 5 月 16 日 · 5084 次点击

这是一个创建于 3681 天前的主题,其中的信息可能已经有所发展或是发生改变。

Polymer 版本: 1.4.0 Web Components 版本: 0.7.22

比如模板中的: <span onclick=""></span>

这时该组件的一个函数是这样的:

handleClick: function(e) {
  // do something
}

可是无法这样调用: <span onclick="{{handleClick}}"></span>

如果将函数写在 Polymer 外部, 那么这个函数的作用域就会被放大到全局. 想尽量避免这样的事情.