聚合物2.0:先决条件是什么? [英] Polymer 2.0: What are the prerequisites?

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

问题描述

我是Web开发的新手,并且对JavaScript(循环,函数,对象)有基本的了解,最近我开始学习Polymer 2.0,并且已经为此苦苦挣扎了一段时间.

I'm relatively new to web development and have a basic understanding of JavaScript (loops, functions, objects) and recently I started learning Polymer 2.0 and I have been struggling with it for a while now.

因此,我绝对需要提高自己的技能.在再次尝试使用Polymer之前,请提供一些我应该参考的资源.

So I definitely need to brush up my skills. Please provide some resources that I should refer before trying out Polymer again.

我正在努力的事情:

  1. 文档,似乎太复杂了.
  2. 将对象数据从一个自定义元素传递到另一自定义元素,并使用触发和调度之类的功能.

推荐答案

好吧,我建议您先尝试使用1.8聚合物.我从事JavaScript已有2年和1年的聚合物开发经验.几周前,我尝试了聚合物2.0,我不得不说它完全像在地狱中(至少对我而言)

well, i would suggest you to try 1.8 polymer first. I have been developing in javascript for 2 years and 1 year in polymer. Few weeks ago i tried polymer 2.0 and i have to say that it is completely like in hell (at least for me)

关于所有元素和聚合物本身,没有完整的文档.我需要在stackoverflow上找到的所有内容,某些属性已更改,并且没有人注意到这一点.因此,Polymer 2.0对于初学者来说真的很难理解.当您不了解javascript本身时,甚至更多.

There is no complete documentation for all elements and polymer itself. Everything i needed i had to find on stackoverflow, some properties has changed and noone ever noticed about that. So Polymer 2.0 is for beginner really hard to understand. Even more when you don't know javascript itself.

从Polymer 1.8开始可能是更好的解决方案,因为您不需要使用ES6( https://www.youtube.com/watch?v=UBmQpD2RrPU ). (我知道,有混合元素,但主要目的是使用class definiton). ES6真的很棒,如果您真的想在Polymer 2.0中进行开发,则应该首先学习它.但是对于从未听说过OOP的人来说,这会使一切变得更加艰难(

Starting with Polymer 1.8 is propably better solution, since you don't need to use ES6 (https://www.youtube.com/watch?v=UBmQpD2RrPU). (I know, there are hybrid elements, but main purpose is to use class definiton). ES6 is really amazing and if you really want to develop in polymer 2.0, you should learn it first. But it makes everything much more harder for someone, who never heard about OOP (what is OOP and how to use it in JS?).

关于您的问题:

文档似乎很复杂:

这可能是不对的.您只需要弄清楚一些事情即可.聚合物本身只是连接元素. Polymer的功能用于在应用程序之间传递数据,与 DOM 以及变量等一起使用. 正如您在文档中看到的那样,方法很多(与Polymer的大小相比).

This is propably not right. You just need to make some things clear. Polymer itself just connecting elements. Polymer's functions are used to pass data across application, work with DOM, and with variables and so on. As you can see in documentation there aren't much methods (in compare to size of Polymer).

只是为了告诉您一些有关元素的信息,Polymer团队创建了带有前缀(铁,纸,霓虹灯等)的元素.铁元素主要用于某些逻辑,它们执行用户看不见或未设置样式的操作在材料设计中.

Just to tell you something about elements, Polymer team created elements with prefixes (iron, paper, neon etc. ) Iron elements are mostly used for some logic, they do something that user can't see or they aren't styled in material-design.

纸张元素正在显示内容.基于材料设计的图形.

Paper elements are displaying something. with material-design based graphics.

,依此类推.您可以在此处找到有关元素的所有信息: https://elements.polymer-project.org/

and so on. You can everything about elements find here: https://elements.polymer-project.org/

您的第二个问题:

将对象数据从一个自定义元素传递到另一个

这已经是您需要自己了解的东西.只需按照Polymer网站上的简单分步操作教程 .我已经可以在这里写一本书了.有一次,我不得不教我的同事,他的javascript不太好(只是学生),这很痛苦.我们在屏幕前呆了3个多小时,即使在那之后,他也无法独自完成简单的任务.

This is already something you need to understand on yourself. Just follow easy step-by-step tutorial from Polymer site. I could write a book here already about this. Once, I had to teach my co-worker who wasn't so good in javascript (just student) and it was pain. We spend more than 3 hours of sitting in front of screen and even after that he wasn't able to do easy tasks alone.

和您的最后一个问题

使用开火和调度之类的功能

正如我所说.我在Polymer中开发应用程序已有1年了,这些功能很少在我的代码中使用. Fire很棒,如果您在DOM树中有一些嵌套元素或某处,并且从1个元素开始,您需要调用另一个元素并告诉他一些有趣的东西.它正在向所有元素广播,这些元素可以捕获此广播并接受它.

As i said. I have been developing apps in Polymer for 1 year and these functions are rarely used in my code. function Fire is great, if you have some nested elements or somewhere in DOM tree and from 1 element you need to call another one and tell him something interessting. It's broadcasting to all elements and these elements can catch this broadcast and accept it.

这有点长,也许会忘记一些东西,所以请问您是否还需要一些东西

This is a little bit long and maybe a forget something, so ask if you need something more

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

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