css + iview 加载动画

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_39517820/article/details/81873638

html

<template>
  <div class="loading">
    <Spin class="img">
      <Icon type="load-c" size=38 class="demo-spin-icon-load"></Icon>
      <div>正在拼命加载中...</div>
    </Spin>
  </div>
</template>

css


<style scoped>
.loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  z-index: 999;
}
.loading .img {
  display: block;
  width: 200px;
  height: 100px;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  margin: auto;
  font-size: 18px;
  color: #fff;
}
/*加载中icon样式*/
.demo-spin-icon-load {
  animation: ani-demo-spin 1s linear infinite;
}
@keyframes ani-demo-spin {
  from {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(180deg);
  }
  to {
    transform: rotate(360deg);
  }
}
</style>

猜你喜欢

转载自blog.csdn.net/qq_39517820/article/details/81873638