Code Monkey home page Code Monkey logo

react-newssys's Introduction

React新闻网站

react

Ant Design样式框架使用

  • ANT DESIGH
  • 蚂蚁金服使用$ npm install antd --save
  • 详细信息请查看官网

头条新闻的数据接口简介

  • 采用Postman来管理接口
  • Postman

PC端页头组件开发

  • 下载头部图标ICONFINDER
  • 采用栅格与FLEX布局
  • 头部组件采用Menu控件,子元素为Menu.Item

移动端页头组件开发

  • 移动端响应式布局,采用react-responsenpm一下。
import React from 'react';
import ReactDOM from 'react-dom';
import {Router, Route, hashHistory} from 'react-router';
import {Button} from 'antd';
import 'antd/dist/antd.css';
import PCIndex from './components/pc_index';
import MBIndex from './components/mb_index';
import MediaQuery from 'react-responsive';
export default class Root extends React.Component {
  render() {
    return (
      <div>
        <MediaQuery query='(min-device-width:1224px)'>
          <PCIndex/>
        </MediaQuery>
        <MediaQuery query='(max-device-width:1224px)'>
          <MBIndex />
        </MediaQuery>
      </div>
    );
  };
}

ReactDOM.render(
  <Root/>, document.getElementById('mainContainer'));
  • index.html中记得书写✍️meta标签,帮助识别响应式布局
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">

PC端页脚开发

  • pc_footer.js中写入代码,填写相应的
import React from 'react';
import {Row,Col} from 'antd';
export default class PCFooter extends React.Component {
  render(){
    return(
      <footer>
        <Row>
          <Col span={2}></Col>
          <Col span={20}>
            &copy;&nbsp;2016 ReactNews. All Right Reserved.
          </Col>
          <Col span={2}></Col>
        </Row>
      </footer>
    )
  }
}

移动端页脚组件开发

  • mb_footer.js中写入代码
import React from 'react';
import {Row,Col} from 'antd';
export default class MBFooter extends React.Component {
  render(){
    return(
      <footer>
        <Row>
          <Col span={2}></Col>
          <Col span={20}>
            &copy;&nbsp;2016 ReactNews. All Right Reserved.
          </Col>
          <Col span={2}></Col>
        </Row>
      </footer>
    )
  }
}

注册功能模块

  • 采用fech框架进行开发
  • npm install fech

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.