当前位置: 首页 > news >正文

效果图网站接单微信手机网页版登录入口官网

效果图网站接单,微信手机网页版登录入口官网,广东h5网站建设,网站开发营销型大前端 东南水乡 一叶小舟拂过水面 船上两位大侠把酒言欢 一位是玉真人 另一位是张真人 两人喝到开心处 变作对联起来 上联 前端研究#xff0c;研究个屁~ 下联 前端设计#xff0c;设计个屁~ 横批 前端sb特色 polymer 提供创建自定义和标准dom元素类似的自定义元素功能 可以… 大前端 东南水乡 一叶小舟拂过水面 船上两位大侠把酒言欢 一位是玉真人 另一位是张真人 两人喝到开心处 变作对联起来 上联 前端研究研究个屁~ 下联 前端设计设计个屁~ 横批 前端sb 特色 polymer 提供创建自定义和标准dom元素类似的自定义元素功能 可以使用constructor或者document.createElement创建元素可以配置元素attributes或properties可以在标签内部定义一些dom可以对属性和属性的变化处理可以有一些默认的样式,在外部修内部样式可以提供方法允许你来操纵它的内部状态一个基本的polymer元素定义如下: dom-module idelement-namestyle/* CSS rules for your element *//styletemplate!-- local DOM for your element --div{{greeting}}/div !-- data bindings in local DOM --/template /dom-modulescript// element registrationPolymer({is: element-name,// add properties and methods on the elements prototypeproperties: {// declare properties for the elements public APIgreeting: {type: String,value: Hello!}}}); /script 像普通标签一样使用 element-name/element-name !-- divhello!/div -- 注册和生命周期 注册自定义元素 使用polymer注册一个元素使用is属性指明要注册元素的名称 // register an element MyElement Polymer({is: my-element,// See below for lifecycle callbackscreated: function() {this.innerHTML My element!;}});// create an instance with createElement: var el1 document.createElement(my-element);// ... or with the constructor: var el2 new MyElement(); polymer function 将元素注册到浏览器上 并且 返回一个创建新实例的元素构造函数 定义一个自定义构造函数 polymer function返回一个基本的构造函数可用于实例化自定义元素如果你想要向构造函数传递参数配置新元素您可以指定一个自定义构造函数原型。 MyElement Polymer({is: my-element,constructor: function(foo, bar) {this.foo foo;this.configureWithBar(bar);},configureWithBar: function(bar) {...}});var el new MyElement(42, octopus); 自定义函数只当使用构造函数时调用作为html标记解析时不调用自定义函数在元素初始化后调用扩展html元素 MyInput Polymer({is: my-input,extends: input,created: function() {this.style.border 1px solid red;}});var el1 new MyInput(); console.log(el1 instanceof HTMLInputElement); // truevar el2 document.createElement(input, my-input); console.log(el2 instanceof HTMLInputElement); // true 回调生命周期 MyElement Polymer({is: my-element,created: function() {console.log(this.localName # this.id was created);},attached: function() {console.log(this.localName # this.id was attached);},detached: function() {console.log(this.localName # this.id was detached);},attributeChanged: function(name, type) {console.log(this.localName # this.id attribute name was changed to this.getAttribute(name));}}); 准备回调和元素初始化 ready: function() {!-- access a local DOM element by ID using this.$ --this.$.header.textContent Hello!; } 元素初始化顺序 created callbacklocal DOM constructeddefault values setready callbackcustom constructor (if any)attached callback注册回调 Polymer.Base also implements registerCallback, which is called by Polymer() to allow Polymer.Base to supply a layering system for Polymer features. 标签静态属性 如果一个自定义标签需要标签上出现attributes要在hostAttrbuites下写 值为true会被转变为空false 该属性不会添加 mixins属性 fun-mixin.html FunMixin {funCreatedCallback: function() {this.makeElementFun();},makeElementFun: function() {this.style.border border: 20px dotted fuchsia;;}};}); my-element.html link relimport hreffun-mixin.htmlscriptPolymer({is: my-element,mixins: [FunMixin],created: function() {this.funCreatedCallback();}}); /script 类样式的构造函数 如果你想实现你的元素但并不注册他你可以使用Polymer.class function Polymer.class和Polymer有着相同的属性配置设置原型链没有注册元素可以用document.registerElement 注册。 申明属性 你可以在你的元素上声明有哪些properties通过在polymer构造函数原型properties写可以声明那些配置属性类型默认值属性改变观察者只读出发事件基于别的属性计算属性属性值改变时跟新相关 Polymer({is: x-custom,properties: {user: String,isHappy: Boolean,count: {type: Number,readOnly: true,notify: true}},ready: function() {this.innerHTML Hello World, I am a bCustom Element!/b;}}); keydetailstype(Boolean,Date,Number,String,Array,Object)value(Boolean,Number,String,Function) 默认值reflectToAttribute(Boolean)readyOnly(Boolean)notify(Boolean)computed(String)observer(String) 属性观察者函数名property name 和 attribute name 映射 当映射 attribute name 到 property names attribute names 转换成 小写 property names 比如firstName 映射成 firstnameattribute names 带破折号 转换成 驼峰命名 property namses 比如first-name 映射成 firstNameproperty names 映射成 attribute names时一致 反序列化属性 属性最好设置type scriptPolymer({is: x-custom,properties: {user: String,manager: {type: Boolean,notify: true}},attached: function() {// renderthis.innerHTML Hello World, my user is (this.user || nobody) .\n This user is (this.manager ? : not) a manager.;}});/scriptx-custom userScott manager/x-custom !-- x-customs innerHTML becomes: Hello World, my user is Scott. This user is a manager. -- attributes dash-case 风格 转换成 camel-case 风格 scriptPolymer({is: x-custom,properties: {userName: String}});/scriptx-custom user-nameScott/x-custom !-- Sets x-custom.userName Scott; -- 配置默认属性值 properties 的默认值可以再properties对象使用value属性 可以是一个原始值或者一个function的返回值 Polymer({is: x-custom,properties: {mode: {type: String,value: auto},data: {type: Object,notify: true,value: function() { return {}; }}}}); 属性更改回调观察者 Polymer({is: x-custom,properties: {disabled: {type: Boolean,observer: disabledChanged},highlight: {observer: highlightChanged}},disabledChanged: function(newValue, oldValue) {this.toggleClass(disabled, newValue);this.highlight true;},highlightChanged: function() {this.classList.add(highlight);setTimeout(function() {this.classList.remove(highlight);}, 300);}}); 观察多个属性更改 Polymer({is: x-custom,properties: {preload: Boolean,src: String,size: String},observers: {preload src size: updateImage},updateImage: function(preload, src, size) {// ... do work using dependent values}}); 观察更改子属性 local Dom 我们叫把可以创造和管理的dom叫local dompolymer支持创建multiple local dom 在支持shadow dom的浏览器上 shadow dom用来创建local dom在其他浏览器 polymer通过自定义实现的shadow dom提供local dom local dom template 使用dom-module元素表现local dom-module的id元素对应元素 is property在dom-module内 放置template polymer会自动拷贝模板内容为元素的local dom dom-module idx-footemplateI am x-foo!/template /dom-modulescriptPolymer({is: x-foo}); /script scoped styling dom-module idmy-elementstyle:host {display: block;border: 1px solid red;}#child-element {background: yellow;}/* styling elements distributed to content (via ::content) requires *//* using a wrapper element for compatibility with shady DOM */.content-wrapper ::content .special {background: orange;}/styletemplatediv idchild-elementIn local Dom!/divdiv classcontent-wrappercontent/content/div/template/dom-modulescriptPolymer({is: my-element});/script Styling distributed children (::content) 在这个例子,这个规则 .content-wrapper ::content .special 翻译为 .content-wrapper special Automatic node finding 内部元素使用id声明 使用this.$ hash选择 DOM (re-)distribution
http://wiki.neutronadmin.com/news/425570/

相关文章:

  • 网站打不开dns修改吗企业手机网站案例
  • 建筑模型设计网站建设wordpress 代码 工具
  • 山东省城乡建设部网站首页南昌网站制作方案定制
  • 石嘴山网站seo谷歌商店下载
  • 西部数码 成品网站想招聘员工去哪个网站
  • vs2015可以做网站么石家庄网站建设今天改网名
  • 广东网站设计工具wordpress postid
  • 做网站的股哥装修广告做哪个网站最好看
  • 建一个网站是不是要开公司株洲做网站
  • 有没有便宜的网站制作seo站群干什么的
  • 六盘水网站建设58同城鞍山招聘信息
  • 网站建设书籍论文页面设计包括什么
  • app与移动网站开发考试资料dedecms网站上传服务器不是空间
  • 中国营销型网站有哪些天蝎网站建设公司
  • 大同网站设计网站域名申请流程
  • 有了网站源代码网站建设视频讲解
  • 陕西专业网站建设公司免费app软件
  • 2003服务器怎么挂网站怎么注册中视频账号
  • 深圳宝安网站推广软件开发公司属于什么企业类型
  • 深圳设计网站推荐中企动力手机邮箱
  • 网站标题分隔符网页制作基础教程简介
  • 东莞网站优化关键词排名响应式网站模板的应用
  • 排版设计网站徐州有哪些制作网站的公司吗
  • 南京平台网站建设设计中国北京
  • 建站网站教程视频教程wordpress主题:yusi
  • 广告项目网站开发wordpress打开超级慢
  • 池州城乡住房建设厅网站长沙网站制作策划
  • 电商网站功能介绍做淘客网站需要多大的空间
  • dede 企业网站模板下载网页设计实训报告主要内容
  • php怎么做搭建网站扬州西区网站建设