首页 > 其他分享 >vue首屏加载动画打包后失效

vue首屏加载动画打包后失效

时间:2024-05-28 10:24:51浏览次数:10  
标签:动画 vue 100% 首屏 loading animation height rotate dot

本地环境运行时,没有问题,打包后,加载动画没有效果,尝试修改:extract: false 后成功。

 加载动画示例:

index.html中

<link rel="stylesheet" href="static/css/loading.css" />

<body> <div id="app"> <div id="appLoading"> <div class=loading-box> <div class=loading-wrap><span class="dot dot-spin"><i></i><i></i><i></i><i></i></span></div> </div> </div> </div> <!-- built files will be auto injected --> </body>

静态文件下添加loading.css

#appLoading {
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  position: absolute;
  z-index: 999;
}

.loading-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.loading-box .loading-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 98px;
}

.dot {
  position: relative;
  box-sizing: border-box;
  display: inline-block;
  width: 32px;
  height: 32px;
  font-size: 32px;
  transform: rotate(45deg);
  animation: ant-rotate 1.2s infinite linear;
}

.dot i {
  position: absolute;
  display: block;
  width: 14px;
  height: 14px;
  background-color: #1890ff;
  border-radius: 100%;
  opacity: 0.3;
  transform: scale(0.75);
  transform-origin: 50% 50%;
  animation: ant-spin-move 1s infinite linear alternate;
}

.dot i:nth-child(1) {
  top: 0;
  left: 0;
}

.dot i:nth-child(2) {
  top: 0;
  right: 0;
  animation-delay: 0.4s;
}

.dot i:nth-child(3) {
  right: 0;
  bottom: 0;
  animation-delay: 0.8s;
}

.dot i:nth-child(4) {
  bottom: 0;
  left: 0;
  animation-delay: 1.2s;
}

@keyframes ant-rotate {
  to {
    transform: rotate(405deg);
  }
}

@keyframes ant-spin-move {
  to {
    opacity: 1;
  }
}

 

标签:动画,vue,100%,首屏,loading,animation,height,rotate,dot
From: https://www.cnblogs.com/Ireneblogs/p/18217273

相关文章

  • 动态渲染之vue页面向组件间传值
    ==Vue页面文件==//vue文件引入组件importceliangjulifrom"@/components/Map/celiangjuli.vue";//使用组件key:celiangMethod(任意名)<celiangjuli:celiangMethod="celiangMethod"></celiangjuli>////定义初始化valueletceliangMethod=ref();//......
  • nginx 配置 vue History模式
    解决需要加一行try_files$uri$uri//index.html;,其中/index.html是你自己的目录中的入口文件server{listen[::]:80default_server;#root/var/www/html;#Addindex.phptothelistifyouareusingPHPindexindex.htmlindex......
  • vue动态添加输入框简单案例
    <!DOCTYPEhtml><htmllang="en"><head><metacharset="UTF-8"><metaname="viewport"content="width=device-width,initial-scale=1.0"><title>Document</title>&l......
  • 彻底搞清楚vue3的defineExpose宏函数是如何暴露方法给父组件使用
    前言众所周知,当子组件使用setup后,父组件就不能像vue2那样直接就可以访问子组件内的属性和方法。这个时候就需要在子组件内使用defineExpose宏函数来指定想要暴露出去的属性和方法。这篇文章来讲讲defineExpose宏函数是如何暴露出去这些属性和方法给父组件使用。注:本文中使用的vue......
  • Vue框架-路由
    VueRouter笔记1.路由管理安装方式一:采用单页面CDN引入方式使用.方式二:基于vite构建的前端项目工程,安装依赖:在项目根目录下,安装:npminstallvue-router@4-s检查项目根目录下package.json中的dependencies是否多出:"vue-router"依赖.路由简单使用在sr......
  • Vue+OpenLayers7入门到实战:OpenLayers实现在地图上拖拽编辑修改绘制图形
    返回《Vue+OpenLayers7》专栏目录:Vue+OpenLayers7入门到实战前言本章介绍如何使用OpenLayers7在地图上拖拽编辑修改绘制图形。在前面一章中,我们已经学会了如何绘制基础的三种图形线段、圆形和多边形:《Vue+OpenLayers7入门到实战:OpenLayers图形绘制功能,OpenLayers实现在地......
  • vue项目创建(git-bash版本)
    前言        1、安装git-bash        2、安装node.js        3、npm包管理工具安装        4、安装webpack工具        5、安装vue-cli        6、创建项目        7、问题报错解决方案前言      ......
  • Vue3实战笔记(46)—Vue 3高效开发定制化Dashboard的权威手册
    文章目录前言Dashboard开发总结前言后台管理系统中的Dashboard是一种图形化的信息显示工具,通常用于提供一个特定领域或系统的概况。它可以帮助用户监控和分析数据,快速获取重要信息。可以帮助用户监控业务状况、分析数据、获取关键信息和管理资源。通过合理的设计和......
  • Vue3实战笔记(47)— 一探emit奥秘——组件间通信的艺术与实践
    文章目录前言一、Vue2中的emti二、Vue3的emit总结前言Vue封装了自定义组件之后,如果子组件想要向父组件传递数据该怎么办?Vue.js中的emit方法就是主要用于组件间的通信,特别是父组件与子组件之间的通信机制。它是Vue组件内部触发自定义事件并向父级组件传递数......
  • 基于SpringBoot+Vue+uniapp的IT技术交流和分享平台的详细设计和实现(源码+lw+部署文档
    文章目录前言具体实现截图技术栈后端框架SpringBoot前端框架Vue持久层框架MyBaitsPlus系统测试系统测试目的系统功能测试系统测试结论为什么选择我代码参考数据库参考源码获取前言......