React_Redux_使用Antd实现TodoList页面布局_ZHOU125disorder_

Antd

antd 是基于 Ant Design 设计体系的 React UI 组件库,主要用于研发企业级中后台产品。

安装

使用 npm 或 yarn 安装#
我们推荐使用 npm 或 yarn 的方式进行开发,不仅可在开发环境轻松调试,也可放心地在生产环境打包部署使用,享受整个生态圈和工具链带来的诸多好处。
$ npm install antd --save
$ yarn add antd

如果你的网络环境不佳,推荐使用 cnpm
cnpm

1.引入样式:

引入Ant Design的css样式的文件

import 'antd/dist/antd.css'; // or 'antd/dist/antd.less'

2.引入控件

import { Input } from 'antd';

在render中使用即可:

  render() {
    return (
      <Fragment>
        <Input />
      </Fragment>
    )
  }

全部代码

import { Input,Button } from 'antd';
import 'antd/dist/antd.css';
import { List, Typography, Divider } from 'antd';
import React, { Component, Fragment } from 'react';

  const data = [
  'Racing car sprays burning fuel into crowd.',
  'Japanese princess to wed commoner.',
  'Australian walks 100km after outback crash.',
  'Man charged over missing wedding girl.',
  'Los Angeles battles huge wildfires.',
];

class TodoList extends Component{
  constructor(props) {
    super(props);
  }
  render() {
    return (
      <Fragment>
        <Input style={{width:"300px"}}/>
        <Button type="primary">Primary Button</Button>
          <List
          bordered
          dataSource={data}
          renderItem={item => (
        <List.Item>
          {item}
        </List.Item>
      )}
    />
      </Fragment>
    )
  }
}

export default TodoList;

Antd更多使用方法

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值