Git Product home page Git Product logo

vue-fullscreenloading's Introduction

vue-fullscreenloading

基于Vue的全屏加载动画效果。线上效果

English document

效果预览

Image text

赞赏

请作者喝瓶可乐吧!(微信号:ligenmt)

微信扫一扫

特别鸣谢

前言

这是基于vue的全屏加载动画效果,可以显示加载进度,有两种使用方式,一是能获取加载进度时手动控制加载进度效果,二是当不知道加载进度(如调用后端耗时接口)时由控件自动显示平滑的加载进度效果。

使用说明

手动控制

    let loadingui = this.$loadingui({
        type: 'default',
        callback: () => {
            // 加载结束回调
            console.log("finish")
        },
    })
    let percent = 0
    let obj = setInterval(() => {
        percent += 2
        //控制加载进度显示效果
        loadingui.loadPercent = percent
        if (percent >= m) {
            // 关闭
            loadingui.close()
            clearInterval(obj)
        }
    }, 50)

自动控制

    let loadingui = this.$loadingui({
        type: 'auto',
        callback: () => {
            // 加载结束回调
            console.log("finish")
        },
    })
    let percent = 0
    let obj = setInterval(() => {
        percent += 1
        if (percent >= 50) {
            // 关闭时不会立刻结束动画效果,而是继续显示加载效果直至100%,显得更友好真实:)
            loadingui.close()
            clearInterval(obj)
        }
    }, 50)

License

MIT

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.