JSX并不是使用React的一个强制需求。当你不需要在你的构造环境里设置编译那么不使用JSX会很方便。 每一个JSX元素只是调用React.createElement(componnet, props, ...children)的语法糖。因此,JSX能做的事原生js同样也做得到。 举个例子,下面的代 ...
分类:
Web程序 时间:
2017-03-01 16:33:27
阅读次数:
190
题目链接:Codeforces Round #400 E. The Holmes Children 题意: 定义f(1)=1,f(n),n>1的值为满足x+y=n且gcd(x,y)=1的(x,y)个数;定义g(n)=Σd|n f(n/d);定义Fk(n)满足k=1时Fk(n)=f(g(n)),k>1 ...
分类:
其他好文 时间:
2017-02-25 18:56:17
阅读次数:
210
经过大半年的等待,kbmmw 的新版终于来了。经过近5年的打磨, kbmmw 的版本号升级到5了。kbmMW is a portable, highly scalable, high end application server and enterprise architecture integra ...
分类:
其他好文 时间:
2017-02-22 22:57:04
阅读次数:
259
this.props.children children是一个例外,不是跟组件的属性对应的 表示组件的所有子节点 HTML5中有一种标签:列表 <ul> <ol> <li> 定义一个列表组件,列表项中显式的内容,以及列表项的数量都由外部决定 ...
分类:
其他好文 时间:
2017-02-22 19:25:04
阅读次数:
205
问题:ul中有若干个li,每次点击li,输出li的索引值 <script> var lis=document.getElementsByTagName('ul')[0].children; for(var i=0;i<lis.length;i++){ (function(index){ lis[i] ...
分类:
其他好文 时间:
2017-02-22 12:56:01
阅读次数:
148
根本上,JSX只是为React.createElement(component, props, ...children)函数提供语法糖。JSX代码是这样的: 编译成这样: 你也可以使用自己闭合的标签块如果它们没有子元素。 编译成这样: 如果你想要测试JSX是怎样转换成js的,你可以试一试在线Babe ...
分类:
Web程序 时间:
2017-02-22 12:36:17
阅读次数:
130
此文章是webmagic 0.1.0版的设计手册,后续版本的入门及用户手册请看这里:https://github.com/code4craft/webmagic/blob/master/user-manual.md 之前就有网友在博客里留言,觉得webmagic的实现比较有意思,想要借此研究一下爬虫 ...
分类:
编程语言 时间:
2017-02-21 17:48:24
阅读次数:
541
Content is what is passed as children. View is the template of the current component. The view is initialized before the content and ngAfterViewInit() ...
For example we have a component: For TodoAppComponent, we make 'TodoList' as 'viewProviders'. And inside TodoAppComponent, we have TodoInputComponent ...
分类:
其他好文 时间:
2017-02-20 01:01:33
阅读次数:
209
向下遍历dom树的jquery方法 children()方法返回被选元素的所有直接子元素,只会对向下一级对dom树进行遍历。 例子 代码: $(document).ready(function(){ $("div").children().css({"color":"red","border":"2 ...
分类:
Web程序 时间:
2017-02-19 10:47:13
阅读次数:
211