1 Star 0 Fork 0

reactJsObject/myReactdemo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
spread.html 1.52 KB
一键复制 编辑 原始数据 按行查看 历史
涎涎 提交于 2017-08-08 14:23 . Add files via upload
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" href="css/table.css"/>
</head>
<body>
<div id="app"></div>
</body>
</html>
<script src="js/react.min.js"></script>
<script src="js/react-dom.min.js"></script>
<script src="js/browser.js"></script>
<script type="text/babel">
var FancyLink = React.createClass({
render: function() {
/*
var attr = {
href: 'http://example.org',
target: '_blank',
};
// return <a {...attr}>Hello</a>;
return (
<a
href={attr.href}
target={attr.target}>
Hello
</a>
);
*/
/*
switch(this.props.size) {
// do something based on the `size` prop
}
var attribs = Object.assign({}, this.props); // shallow clone
delete attribs.size;
*/
var {size, ...attribs} = this.props;
switch(size) {
// do something based on the `size` prop
}
return <a {...attribs}>{this.props.children}</a>;
}
});
ReactDOM.render(
<div>
<FancyLink
href="http://example.org"
style={{color: "red"}}
target="_blank"
size="medium">
Hello
</FancyLink>
</div>,
document.getElementById('app')
);
</script>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/reactJsObject/myReactdemo.git
[email protected]:reactJsObject/myReactdemo.git
reactJsObject
myReactdemo
myReactdemo
master

搜索帮助