learning-report's People
learning-report's Issues
polymer-元素生命周期
问题1: 元素的 ready 和 domReady 有什么区别,一般如何使用他们?
问题2: 以下数据段定义中,哪些地方不合理? 如何操作更合适, 为什么?
Polymer({
foo: 'foo',
bar: 'bar',
foobar: [],
settings: {
text: 'hello foobar'
},
created: function () {
},
ready: function () {
console.log('foobar ready!');
},
});
ans-five 点评
答案:
Polymer({
foo: 'foo',
bar: 'bar',
created: function () {
this.foobar = [];
this.settings = {
text: 'hello foobar'
};
},
ready: function () {
console.log('foobar ready!');
},
});
请告诉我为什么是这样的设计?
ans-two 点评
你的回答没有对应的 Issue 所以我无法根据你的提交进行 review 或评论. 请下次记得灵活运用 Github 的这些工具来组织自己的答案. 你的答案不是用 md 书写, 所以文本组织方面让人看起来比较费劲, 也请改进这方面的交流方式.
ans-two
- "DOM如何停止消息传递?", 这个回答可能没有说到重点. 阻止消息传递的方法我们一般使用 event.stopPropagation. removeEventListener 并不会停止传递, 他只会停止消息.
- 没有回答到重点. 我只问你 stopPropagation 和 preventDefault 的区别.
- OK, 回答请严谨一些, balabalabala的措辞只会让人觉得你是一个非科班出身的程序员.
- 回答错误, 请在思考一下这个问题, 并详细的写出整个事件响应的过程.
- 不用复述大家都知道的知识点, 重点在于表达自己对于 capture 和 bubble 的观点, 既然是发散性的问题, 他更多的是希望答题者如何考虑这样一个问题, 以及自己的见解. 当你通过文案学习到一个新事物的规则而没有具体经验的时候, 正是你用自己方式思考他的机会, 这样才能够有新的创造力.
polymer-工具和其它
任务
请将之前已有的项目通过 gulp 和 vulcanize 编译成一个发布包.
polymer-数据绑定
问题
Polymer 中 [[]] 和 {{}} 的绑定有什么不同?
数据绑定可以通过 {{ foo | bar(20) }} 传参数, 消息/事件绑定是否也有类似的方式方法?
Polymer 中的 publish 变量的作用是什么? publish 变量中定义 reflect 的作用又是什么?
在一份自定义 Polymer 元素代码中, this.$.foobar 会取到哪个元素?
如何监控自定义元素的变量的改变? 有几种监控的方法?
进阶问题
模板引用(template ref)是什么? 能否单纯使用模板引用技术实现一个树形控件?
如何发起一个自定义消息? 你又会如何在元素中响应这个自定义消息?
如果不通过 {{}} 的方式进行绑定, 而是通过 Javascript 动态绑定,该如何实现?
问题4:
有以下代码:
{{value.name}} = {{value.data.x}}, {{value.data.y}}<script>
Polymer({
publish: {
value: { data: {x: 0, y: 0}, name: 'no name' }
},
valueChanged: function () {
console.log("value changed");
},
});
</script>
<script>
var tmpl = document.querySelector('#my-template');
tmpl.foo = { data: { x: 20, y: 30 }, name: "foobar" }
tmpl.clickAction = function ( event ) {
tmpl.foo.data.x = 50;
}
</script>
问题5:
有以下代码:
foobar = {{value.data.x}}, {{value.data.y}}<script>
Polymer({
publish: {
value: { data: { x: 0, y: 0 } }
},
observe: {
'value': 'valueChanged',
},
valueChanged: function () {
console.log("value changed");
},
});
</script>
<script>
var tmpl = document.querySelector('#my-template');
tmpl.foo = { x_: 10, y_: 20 };
Object.defineProperty(tmpl.foo, 'data', {
get: function () {
return { x: this.x_, y: this.y_ };
},
set: function (value) {
this.x_ = value.x;
this.y_ = value.y;
}
});
tmpl.clickAction = function ( event ) {
tmpl.foo.data = { x: 50, y: 100 };
}
</script>
来搞主站bug啊~
来搞主站bug啊~
ans-three 点评
这样的答题页面我下载到本地也跑不起来, 他缺少库, 缺少使用说明的 Readme, 缺少自己对该问题解决方式的描述.
如果认真对待 Learning-Report 这个仓库, 我想你会为每一个问题建立一个 Folder, 让 review 的人, 只需要 git clone 你的 repo, 就能够在良好的运行环境中进行 review.
这些程序员的基本功请认真对待.
此外, .html 文件的 tab 请使用一个自定的规范, 我在阅读你的代码中, 发现你的 html, js 的 tab 缩进, 有时 4格, 有时 2格, 有时 8格, 有时更多, 我不能明白你的 repo 里的代码规范是怎样. 请在书写自己的代码时, 也多为读代码的人考虑.
polymer-定义样式
问题
::shadow 和 /deep/ 的区别是什么?
::content 的作用范围在哪?
:host 有存在的必要么? 为什么?
polymer-扩展已有元素
问题
我希望在子类中调用父类的方法,在 Polymer 中是如何来操作的?
假设我扩展了一个父类标签,我希望通过重写局部的 css 来改变继承过来的父类标签中的某些样式, 我该如何操作?
ans-six 点评
{{}}
你的回答中说这是一个动态绑定, 是否能具体说一下什么是动态绑定? 根据你的回答, 我在网上找到的关于动态绑定的定义就是可以在运行时绑定? 如果不是, 请告诉我究竟他是什么? 他最终做了什么?有的吧
, 那究竟是有还是没有? 如果有, 是否能够书写出一个样例证明? 如果没有, 说明理由.- 没回答重点
- 错误
- good
进阶中的 问题 3, 4, 5 没回答.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.