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 ...
随机推荐
- 生成器yield
#!/usr/bin/python#coding=utf-8'''Created on 2017年11月23日 from home @author: James zhan ''' def counte ...
- Eureka的使用
一.项目配置文件:application.yml #------ eureka配置,默认不开启,如需使用rest负载模式需开启 start ------------- eureka: instance ...
- Linux下实现ssh免密认证
添加域名映射 配置ssh免密登陆 拷贝master服务器公钥至本机 验证master服务器ssh免密登录其余服务器 添加域名映射 打开hosts文件 Vim /etc/hosts 添加域名对象 配置s ...
- 用mybatis中的insert方法插入数据,返回值为1,但数据库却没有数据
刚才在写东西的时候,用mybatis中的 <insert id="add" parameterType="cn.entity.Computer"> ...
- mongodb安装建议
1)软件包的选择 确保使用最新的稳定版本.目前我们线上使用的版本是2.4.6.MongoDB软件包下载页面http://www.mongodb.org/downloads. 确保线上环境总是使用64位 ...
- Layer For Mobile 弹窗 input输入文字后,点击取消确定按钮失效(需点击两次)
webapp中使用Layer For Mobile弹出弹窗,修改昵称输入文字后,ios手机中,如果不先点击收起键盘,两个按钮点击之后无效... 两个按钮的方法是写在这里的——> 最后只能吧点击按 ...
- makeObjectsPerformSelector对数组中的对象发送消息执行对象中方法
- (void)makeObjectsPerformSelector:(SEL)aSelector; - (void)makeObjectsPerformSelector:(SEL)aSelector ...
- Linux运维之shell脚本进阶篇
一.if语句的使用 1)语法规则 if [条件] then 指令 fi 或 if [条件];then 指令 fi 提示:分号相当于命令换行,上面两种语法等同特殊写法:if[ -f"$file ...
- c#抓屏功能在DPI缩放后,截到的图片不完整的问题
/// <summary> /// 获取屏幕快照 /// </summary> /// <returns></returns> public stati ...
- day 08文件与字符编码
ASCII 一个字符占一个字节 GBK 中文使用两个字节,英文使用1个字节,使用开头一个比特位标识是英文还是中文 unicode:支持任何国家的语言,全部字符都是使用两个字节 utf-8 一个英文占 ...