🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@tuhu/loading

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tuhu/loading

途虎wepy-loading组件

latest
Source
npmnpm
Version
1.0.4
Version published
Weekly downloads
3
-25%
Maintainers
1
Weekly downloads
 
Created
Source

微信小程序 wepyjs 第三方loading组件

使用

安装组件

nrm use lord
npm login
npm install @tuhu/loading --save

引入组件

// index.wpy
<template>
    <loading></loading>
</template>
<script>
  import wepy from 'wepy';
  import loading from '@tuhu/loading';
  export default class Index extends wepy.page {
    components = {
      loading: loading
    };
  }
</script>

调用方法

showLoading(){
  var self = this;
  this.$invoke('loading','show',{
    border:false,
    text:'Loading',
    spinnerType:'dot',
    position:'top'
  })
  //关闭
  setTimeout(function () {
    self.$invoke('loading','close');
  },2000)
}

说明

组件有6个参数,如下:
border: false,//默认没有边框
text: '',//默认没有文字
spinnerType:'',//spinnerType传'dot'或者'snake',分别是三个点的加载中,和转圈的加载中,默认值为dot
position:''//默认居中,传值'bottom'或者'top'
size: '20rpx',//加载图案大小,默认20rpx
textSize: '20rpx'//字体大小,默认20rpx

FAQs

Package last updated on 30 Oct 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts