Vue 封装的loading组件
<template>
<div class="loadEffect">
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
</div>
</template>
<script type="text/ecmascript-6">
export default {
name: 'loading'
}
</script>
<style lang="less" scoped>
.loadEffect {
width: 50px;
height: 50px;
position: relative;
margin: 0 auto; span {
display: inline-block;
width: 10px;
height: 10px;
border-radius: 50%;
background: grey;
position: absolute;
-webkit-animation: load 1.04s ease infinite;
} @-webkit-keyframes load {
0% {
-webkit-transform: scale(1.2);
opacity:;
}
100% {
-webkit-transform: scale(.3);
opacity: 0.5;
}
} .loadEffect span {
&: nth-child(1) {
left: 0;
top: 50%;
margin-top: -5px;
-webkit-animation-delay: 0.13s;
}
&: nth-child(2) {
left: 7px;
top: 7px;
-webkit-animation-delay: 0.26s;
}
&: nth-child(3) {
left: 50%;
top:;
margin-left: -5px;
-webkit-animation-delay: 0.39s;
}
&: nth-child(4) {
right: 7px;
top: 7px;
-webkit-animation-delay: 0.52s;
}
&: nth-child(5) {
right:;
top: 50%;
margin-top: -5px;
-webkit-animation-delay: 0.65s;
}
&: nth-child(6) {
right: 7px;
bottom: 7px;
-webkit-animation-delay: 0.78s;
}
&: nth-child(7) {
left: 50%;
bottom:;
margin-left: -5px;
-webkit-animation-delay: 0.91s;
}
&: nth-child(8) {
left: 7px;
bottom: 7px;
-webkit-animation-delay: 1.04s;
}
}
}
</style>
以上是loading组件的完整代码,引用方法如下:
<Loading v-if="loading"></Loading>
<script>
export default {
data() {
return {
loading: false
}
},
methods: {
//加载方法
dataLoading(){
this.loading = true;
//加载完成后
this.loading = false;
}
}
}
</script>
Vue 封装的loading组件的更多相关文章
- vue封装一些常用组件loading、switch、progress
vue封装一些常用组件loading.switch.progress github文档https://github.com/zengjielin/vue-component-library loadi ...
- Vue 封装的noData组件
<template> <div :style="{color: fontColor}" :class="['noDataView', iconType] ...
- echart——vue封装成公共组件
<!-- 自定义Echarts * options: Object,//数据 * theme: String,//主题 * initOptions: Object,//初始化 * group: ...
- VUE移动端音乐APP学习【四】:scroll组件及loading组件开发
scroll组件 制作scroll 组件,然后嵌套一个 DOM 节点,使得该节点就能够滚动.该组件中需要引入 BetterScroll 插件. scroll.vue: <template> ...
- vue封装组件的正确方式-封装类似elementui的组件
最近读了下element的源码,仿照他封装了两种不同的组件. 第一种:通过组件来调用显示的 <template> <!--src/component/custom/main.vue- ...
- 基于Vue封装分页组件
使用Vue做双向绑定的时候,可能经常会用到分页功能 接下来我们来封装一个分页组件 先定义样式文件 pagination.css ul, li { margin: 0px; padding: 0px;} ...
- React Native封装Toast与加载Loading组件
React Native开发封装Toast与加载Loading组件 在App开发中,我们避免不了使用的两个组件,一个Toast,一个网络加载Loading,在RN开发中,也是一样,React Nati ...
- vue防抖节流函数---组件封装,防止按钮多次点击
1.vue 封装utils.js /** * @param {function} func 执行函数 * @param {number} time 防抖节流时间 * @param {boolean} ...
- Vue + Element-ui实现后台管理系统(4)---封装一个ECharts组件的一点思路
封装一个ECharts组件的一点思路 有关后台管理系统之前写过三遍博客,看这篇之前最好先看下这三篇博客.另外这里只展示关键部分代码,项目代码放在github上: mall-manage-system ...
随机推荐
- UVa LA 4254 - Processor 二分,贪心 难度: 1
题目 https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_pr ...
- 如何ASP.NET Core Razor中处理Ajax请求[转载]
在ASP.NET Core Razor(以下简称Razor)刚出来的时候,看了一下官方的文档,一直没怎么用过. 今天闲来无事,准备用Rozor做个项目熟练下,结果写第一个页面就卡住了..折腾半天才搞好 ...
- FCC JS基础算法题(10):Falsy Bouncer(过滤数组假值)
题目描述: 删除数组中的所有假值.在JavaScript中,假值有false.null.0."".undefined 和 NaN. 使用filter方法,过滤掉生成的 Boolea ...
- 剑指Offer 27. 字符串的排列 (字符串)
题目描述 输入一个字符串,按字典序打印出该字符串中字符的所有排列.例如输入字符串abc,则打印出由字符a,b,c所能排列出来的所有字符串abc,acb,bac,bca,cab和cba. 输入描述: 输 ...
- Linux 应用——常用函数(usual function)
main函数: 新建testmain.c #include <sys/types.h>#include <sys/stat.h>#include <fcntl.h> ...
- Js/Bind()的认识
1.bind( eventType [, eventData], handler(eventObject))2.向绑定的对象上面提供一些事件方法的行为.其中三个参数的意义分别代表: 一.eventTy ...
- 3.4 unittest之装饰器(@classmethod)
3.4 unittest之装饰器(@classmethod) 前言前面讲到unittest里面setUp可以在每次执行用例前执行,这样有效的减少了代码量,但是有个弊端,比如打开浏览器操作,每次执行用例 ...
- sklearn.model_selection.StratifiedShuffleSplit
sklearn.model_selection.StratifiedShuffleSplit
- webstrom左侧项目栏不显示文件夹问题
在使用webstrom的时候遇到问题: 打开项目,只显示package.json和webpack.config.js其他文件夹和文件都不显示 解决办法: 1.关闭webstrom当前项目 2.找到项目 ...
- day05 集合
今日进度(数据类型) 集合 内存相关 深浅拷贝 1.集合表示 1.无序 2.不重复 3.hash查找 #问题:v={}表示? set: v1=set()#空集合 v1={1,2,3,4,5} dict ...