antd spin css 实现

 <span class="ant-spin-dot ant-spin-dot-spin">
    <i></i><i></i><i></i><i></i>
  </span>
.ant-spin-dot {
  position: relative;
  display: inline-block;
  font-size: 20px;
  width: 20px;
  height: 20px;
}
.ant-spin-dot-spin{
  transform: rotate(45deg);
  animation: antRotate 1.2s infinite linear;
}
 
.ant-spin-dot i {
  width: 9px;
  height: 9px;
  border-radius: 100%;
  background-color: #1890ff;
  transform: scale(0.75);
  display: block;
  position: absolute;
  opacity: 0.3;
  animation: antSpinMove 1s infinite linear alternate;
  transform-origin: 50% 50%;
  &:nth-child(1) {
    left: 0;
    top: 0;
  }
  &:nth-child(2) {
    right: 0;
    top: 0;
    animation-delay: 0.4s;
  }
  &:nth-child(3) {
    right: 0;
    bottom: 0;
    animation-delay: 0.8s;
  }
  &:nth-child(4) {
    left: 0;
    bottom: 0;
    animation-delay: 1.2s;
  }
}
@keyframes antSpinMove {
  to {
    opacity: 1;
  }
}
@keyframes antRotate {
  to {
    transform: rotate(405deg);
  }
}
 

 

文章转自 https://blog.csdn.net/candy_home/article/details/81540247 

antdAnt Design的UI组件库,它提供了一套美观、统一的设计语言和高质量的React组件。在使用antd时,通常需要引入相应的CSS样式文件,以确保组件样式能够正确地显示。 引入antd CSS样式的步骤如下: 1. 首先需要安装antd包,可以通过npm或yarn命令进行安装: ```sh npm install antd --save # 或者 yarn add antd ``` 2. 安装完成后,有两种常用的方法来引入antdCSS样式: - 在项目入口文件(通常是index.js或App.js)中使用import语句引入全局样式: ```javascript import 'antd/dist/antd.css'; // 或者 'antd/dist/antd.less' ``` 这种方式会将antd的所有样式文件引入到你的项目中,适用于对样式没有特殊定制需求的场景。 - 如果你只使用了antd的某些组件,为了减少打包体积,可以按需引入各个组件的样式。可以通过配置babel-plugin-import插件来实现: ```sh npm install babel-plugin-import --save-dev # 或者 yarn add babel-plugin-import --dev ``` 然后在babel配置文件(通常是.babelrc或babel.config.js)中配置插件: ```json { "plugins": [ ["import", { "libraryName": "antd", "style": "css" }] ] } ``` 这样,在你的项目中使用antd组件时,样式会自动按需引入。 3. 使用组件。引入样式后,你就可以在项目中自由地使用antd提供的各种组件了。 注意:antd支持多种样式文件格式,包括css、less等,根据你的项目配置选择合适的格式引入。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值