tdreact写helloworld
来源:互联网 发布:淘宝客可以发展代理吗 编辑:程序博客网 时间:2024/05/24 07:03
1.如果没有npm需要先安装一下npm,
2.新建一个文件夹,新建以下文件,目录结构如下(.idea文件不需要)
3.上述文件内容如下
entry.js
import React,{ Component } from 'react';import ReactDOM from 'react-dom';export default class App extends Component{ render(){ return( <div> hello word! </div> ); }}ReactDOM.render( <App/>, document.getElementById('example'))
test.html
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Title</title></head><body><div id="example"></div></body></html>
postcss.config.js
module.exports = { plugins: () => { return [ require('postcss-nested')(), require('pixrem')(), require('autoprefixer')(is.Object(options) && is.Object(options.autoprefixer) ? options.autoprefixer : { browsers: ['last 2 versions', 'Firefox ESR', '> 1%', 'ie >= 8'] }), require('postcss-flexibility')(), require('postcss-discard-duplicates')() ] }};
app.js为空
4.进入这个项目文件夹,
依次执行
npm i tdtool -D
npm install tdtool-less
npm react
npm react-dom
npm tdtool-react
npm init -y
5.在package.json文件的”scripts”里面加上 “start”: “tdtool start”
6.执行tdtool start(在项目文件夹下)
7.在浏览器输入http://localhost:9090/
就可以看到你的helloword程序
阅读全文
0 0
- tdreact写helloworld
- 不用操作系统写HelloWorld
- eclipse 写HelloWorld
- intellij idea 写 Helloworld
- ionic写helloworld步骤
- 用txt写HelloWorld
- VS上写helloworld
- 用C++写HelloWorld
- QT写helloworld
- py写HelloWorld
- 用GTK+写的HelloWorld
- 用java写一个HelloWorld
- 新手写OFBiz的HelloWorld
- 用struts2写一个helloworld
- 新手写OFBiz的HelloWorld
- 使用Strust2框架写HelloWorld
- 使用Strust2框架写HelloWorld
- 初次使用servlet写HelloWorld
- 2017.12.11学习总结
- Linux(CentOS)下安装Redis(redis-4.0.1)
- FatJar减肥: 解决SpringBoot jar包太大的问题
- [资源分享][UGUI][Unity好文章]如何用unity实现像DOTA2那样的多边形数据雷达图
- Kaldi ------ Install Step
- tdreact写helloworld
- android 内置简单应用
- 更新Android Studio后打开Project报错
- JRE安装或Java更新遇到Error 1603的解决方法
- sqlserver中将数据为12-May 修改为2012-05形式
- java.util.ConcurrentModificationException
- JVM内存监控工具
- BZOJ2243: [SDOI2011]染色(洛谷P2486)
- 不同版本的python共用一个opencv