Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use animation components in Vue loading

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "how to use animation components in Vue loading". In daily operation, I believe many people have doubts about how to use animation components in Vue loading. Xiaobian consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful for you to answer the doubts about how to use animation components in Vue loading. Next, please follow the editor to study!

(imitating the style in ant-design loading) the effect is as follows:

① creates Loading.vue components:

Export default {name: 'Loading'} .m-spin-dot {/ / horizontal and vertical centered position: relative; top: calc (50%-18px); margin: 0 auto; width: 36px; height: 36px; transform: rotate (45deg);-ms-transform: rotate (45deg); / * Internet Explorer * /-moz-transform: rotate (45deg); / * Firefox * /-webkit-transform: rotate (45deg) / * Safari and Chrome * /-o-transform: rotate (45deg); / * Opera * / animation: rotate 1.2s linear infinite;-webkit-animation: rotate 1.2s linear infinite; @ keyframes rotate {100% {transform: rotate (405deg);}} .u-dot-item {/ / single dot style position: absolute; width: 10px; height: 10px; background: @ mainColor; border-radius: 50%; opacity: .3 Animation: spinMove 1s linear infinite alternate;-webkit-animation: spinMove 1s linear infinite alternate; @ keyframes spinMove {100% {opacity: 1;} .u-dot-item:first-child {top: 0; left: 0;} .u-dot-item:nth-child (2) {top: 0; right: 0; animation-delay: .4s;-webkit-animation-delay: .4s U-dot-item:nth-child (3) {bottom: 0; right: 0; animation-delay: .8s;-webkit-animation-delay: .8s;} .u-dot-item:last-child {bottom: 0; left: 0; animation-delay: 1.2s;-webkit-animation-delay: 1.2s;}}

② references on the page to be used:

Import Loading from'@ / components/Loading'components: {Loading}

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report