博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
polymer中的notify和reflectToAttribute
阅读量:6989 次
发布时间:2019-06-27

本文共 1065 字,大约阅读时间需要 3 分钟。

hot3.png

notify and reflectToAttribute. The notify and reflectToAttributeproperties may sound similar: they both make the element's state visible to the outside world. reflectToAttribute makes the state visible in the DOM tree, so that it's visible to CSS and thequerySelector methods. notify makes state changes observable outside the element, either using JavaScript event handlers or Polymer .

用实例演示一下两者的区别。以下代码仅适用于polymer 1.0。

icon-toggle.html 

icon-toggle-demo.html

测试页面:

              

执行效果:

093749_DmVZ_2391658.png

效果影响:

1、如果在icon-toggle中去除:reflectToAttribute: true,则点击图标时,填充效果将无效,但msg效果是有效的,即仍会在:You really like me! 和 Do you linke me?之间切换。

2、如果去除:notify: true 属性,则填充效果有效,但msg的切换效果则会消失。

转载于:https://my.oschina.net/u/2391658/blog/1113886

你可能感兴趣的文章
查看进程信息
查看>>
转载:DIV+CSS有可能遇到的问题
查看>>
protocol buffer
查看>>
web常用模块测试用例
查看>>
【转】分布式数据层 TDDL 来自:阿里巴巴
查看>>
swing常用布局
查看>>
#学习笔记#e2e学习使用(二)
查看>>
LeetCode 222.完全二叉树的节点个数(C++)
查看>>
20180307-Xen、KVM、VMware、hyper-v等虚拟化技术的比较
查看>>
在C#中??和?分别是什么意思?
查看>>
APP 开发,代码写的真烂
查看>>
适合0基础的web开发系列教程-html5新的表单元素
查看>>
fengmiantu
查看>>
HSF从部署到开发到原理分析
查看>>
PHP语言 -- jquery
查看>>
python 常用的函数
查看>>
Codeforces#543 div2 A. Technogoblet of Fire(阅读理解)
查看>>
Hyper-V 3虚拟机快照之一 快照应用介绍
查看>>
ASP.NET中页面传值
查看>>
Flex4中动态生成RadioButton,绑定数据源
查看>>