加载动画

<style>
  .firstChangeLoading ul {
      display: flex;
      align-items: center;
      justify-content: center;
      opacity: 1;
      height: 100%;
      width: 100%;
      position: absolute;
      top: 0;
      left: 0;
      background-color: #fff;
      z-index: 999999999999999;
      border-radius: 0;
    }

    .firstChangeLoading ul li {
      height: 20px;
      width: 20px;
      list-style: none;
      border-radius: 50%;
      background-color: red;
      margin-left: 15px;
      animation: 1.3s loading infinite alternate;
    }

    .firstChangeLoading ul li:first-child {
      margin-left: 0;
      background-color: #ff6666;
    }

    .firstChangeLoading ul li:nth-child(2) {
      background-color: #9933ff;
      animation-delay: .2s;
    }

    .firstChangeLoading ul li:nth-child(3) {
      background-color: #00ccff;
      animation-delay: .4s;
    }
   @keyframes loading {
      from {
        transform: scale(1.2)
      }

      to {
        transform: scale(.4)
      }
    }
</style>

<div id="firstChangeLoading" class="firstChangeLoading">
    <ul>
      <li></li>
      <li></li>
      <li></li>
    </ul>
  </div>





路由配置:
 {
    path: '/profile_binding_phone',
    name: 'ProfileBindingPhone',
    component: importLoading(() => import("../page/profile/settings/page/bindingphone.vue")),
    meta: { title: "绑定手机" }
  }

const importLoading = (importComponent, loadStart, loadSuccess, loadError) => {
    return () => {
        let com = importComponent()
        document.querySelector('#firstChangeLoading').style.display = 'flex';
        loadStart && loadStart()
        com.then(() => {
            loadSuccess && loadSuccess()
            document.querySelector('#firstChangeLoading').style.display = 'none';
        })
            .catch(err => {
                loadError && loadError(err)
            })
        return com
    }
}
export default importLoading
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值