【发布时间】:2015-09-23 14:03:21
【问题描述】:
我正在尝试使用 React 创建列表,所以我正在使用来自这里的模块 https://github.com/pqx/react-ui-tree
我正在尝试示例应用程序: https://github.com/pqx/react-ui-tree/blob/gh-pages/example/app.js
此应用程序呈现以下内容: React.render(, document.getElementById('app'));
在同一个文件夹中,我有一个 HTML 文件,我尝试在其中显示示例应用程序创建的树:
<!doctype html>
<html lang="en">
<head>
<script src="http://fb.me/react-0.13.0.js"></script>
<script src="http://fb.me/JSXTransformer-0.13.0.js"></script>
</head>
<body>
<script src="app.js" type="javascript"></script>
<div id="tree">
</div>
</body>
</html>
但是,当我在浏览器中打开 HTML 页面时,没有呈现任何内容。 我对 Javascript 或 React 没有太多经验。
为什么会这样?
我需要使用 Gulp 或其他工具吗?
【问题讨论】:
标签: javascript html reactjs