Giter VIP home page Giter VIP logo

react-cnode's Introduction

react-cnode

简介

A react-project

构建

# 安装npm包
yarn

# 本地启开发服务
yarn start

# 打包
yarn build

开发

mock

本项目未提供mock服务,需要可以加

接口请求

封装了axios,只需要在./src/services/urls.js里添加你需要的接口路径,然后在./src/services/services.js里添加接口请求的封装,在你需要请求的地方引入即可,封装例子如下

// get /topics 主题首页
topics(options = {}) {
    return new Promise((resolve, reject) => {
        utils.http.request({
            method: 'GET',
            url: urls.topics,
            qs: options
        }, (data) => {
            resolve(data);
        });
    });
},

静态文件

静态文件放在./src/assets/下公共的css和各页面需要的图片和公共js文件、字体等

组件

一些常用公共组件放在./src/components,里面有loading,toast组件例子

页面

页面放在./src/routes下,使用jsx,见 https://reactjs.org/

路由

使用的是react-router4,使用见 https://reacttraining.com/react-router/web/example/basic

工具类函数

工具类函数写在./src/utils/utils.js里,可定义公共函数

状态管理

使用redux https://redux.js.org/

效果图

https://still-bayou-37837.herokuapp.com/reactcnode/index.html#/home

线上地址

https://still-bayou-37837.herokuapp.com/reactcnode/index.html#/home

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.