React UI组件库Ant Design

React UI组件库 AntDesign

Ant Design 官方文档

首先在项目里安装

npm install antd --save
# 或
yarn add antd

使用示例

1.在index.js中引入样式

在全局都可以使用样式

import 'antd/dist/antd.css'; // or 'antd/dist/antd.less' // 样式引入

2.在list1.js中使用走马灯Carousel组件

import React from 'react'
import { Carousel } from 'antd'


const contentStyle = {
  height: '160px',
  color: '#fff',
  lineHeight: '160px',
  textAlign: 'center',
  background: '#364d79',
}

function onChange(current) {
  console.log(current)
}

class List1 extends React.Component {

  render () {
    return (
      <div>
        <h1>list1111</h1>
        <Carousel autoplay  afterChange={onChange}>
          <div>
            <h3 style={contentStyle}>1</h3>
          </div>
          <div>
            <h3 style={contentStyle}>2</h3>
          </div>
          <div>
            <h3 style={contentStyle}>3</h3>
          </div>
          <div>
            <h3 style={contentStyle}>4</h3>
          </div>
        </Carousel>
      </div>
    )
  }

}

export default List1
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值