vue项目生产环境下@key-frames动画为何没有效果?

vue项目中构建的单页面,页面底部有用来提示用户翻页,类似与鼠标滚动的小图标,有个循环的小动画,代码如下(节约时间外层的图标这里不展示了):

@-webkit-keyframes nextAnimation {
0% {height: 4px;}
50% {height: 14px;}
100% {height: 4px; top: 18px;}

}
.next_move{

position: absolute;
top: 6px;
left: 50%;
margin-left: -2px;
width: 4px;
height: 4px;
background: #fff;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
animation: nextAnimation 0.8s infinite 0s linear;

}
好,开发环境没有任何问题:
clipboard.png
clipboard.png

npm run build后丢到服务器,其他地方暂时没发现什么问题,就这里,动效消失了!
尝试清除scoped属性依然能没有效果,编译后的css样式如下:

clipboard.png

求大神解答??

阅读 4.7k
2 个回答

已经解决啦!
vue打包后动画失效!
找到build文件夹中的vue-loader.conf.js,把extract的值改为false---如图

clipboard.png

clipboard.png

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题