codecamp
在 Create React App 中使用

在 Create React App 中使用

要开始使用 uiwCreate React App (CRA),请按照下列步骤操作:

  1. 安装最新版本的 Node LTS。 请参阅此处获取说明

  1. 使用以下命令创建新的 CRA 项目:

npx create-react-app my-app

此时,您将能够在本地启动默认 CRA 应用程序:

cd my-app
yarn start

有关 Create React App 的更多信息,请参阅CRA自述文件

  1. 安装 uiw 包:

yarn add uiw

  1. 打开 src/App.js 并将内容替换为:

import React, { Component } from 'react';
import { Button } from 'uiw';


export default class App extends Component {
  render() {
    return <Button size="small" type="primary">Click Me</Button>;
  }
}
快速上手
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }