Skip to Content
React快速上手开发
book

React快速上手开发

by Stoyan Stefanov
March 2017
Intermediate to advanced
210 pages
5h 1m
Chinese
Posts & Telecom Press
Content preview from React快速上手开发
构建应用
97
6.1.1
 基本设置
首先复制一份
reactbook-boiler
模板应用的源代码,然后把项目重命名为
whinepad
v0.0.1
,并在此基础上进行开发。(可以从
https://github.com/stoyan/reactbook/
下载代码。)
下一步,运行监听脚本,以便在文件内容发生改变时自动重新构建:
$ cd ~/reactbook/whinepad\ v0.0.1/
$ sh scripts/watch.sh
6.1.2
 开始编写代码
修改
index.html
文件中的标题,并把
id
属性修改为
id="pad"
,以匹配我们的应用名称:
<!DOCTYPE html>
<html>
<head>
<title>Whinepad v.0.0.1</title>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="bundle.css">
</head>
<body>
<div id="pad"></div>
<script src="bundle.js"></script>
</body>
</html>
我们把
JSX
版本
Excel
组件的源代码(出现在第
4
章末尾处)复制到
js/source/components/
Excel.js
中:
import React from 'react';
var Excel = React.createClass({
// 省略部分代码 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

JSON實務手冊

JSON實務手冊

Tom Marrs
C++语言导学(原书第2版)

C++语言导学(原书第2版)

本贾尼 斯特劳斯特鲁普
React学习手册

React学习手册

Alex Banks, Eve Porcello
数据压缩入门

数据压缩入门

Colt McAnlis, Aleks Haecky

Publisher Resources

ISBN: 9787115447739