Giter Site home page Giter Site logo

liumulin614 / z-progress-loading Goto Github PK

View Code? Open in Web Editor NEW

This project forked from shallinta/z-progress-loading

1.0 0.0 0.0 23.52 MB

Created with CodeSandbox

Home Page: https://dy7q2.csb.app/

License: MIT License

HTML 7.17% Vue 81.12% JavaScript 11.71%

z-progress-loading's Introduction

z-progress-loading

npm package npm download github license github language top github stars

NPM

基于 canvas 实现的加载进度条 vue 组件。(现在支持基于 dom 实现的配置)

Features

  • 可作为 loading 组件使用
  • 可作为 pregress-bar 组件使用
  • 可作为音乐播放进度条使用

Preview

对应 demo 代码在 examples 目录

How to use

npm install --save z-progress-loading
<template>
  <div #app>
    <ZProgressLoading :progress="progress" :start="start" :config="config" />
  </div>
</template>

<script>
import ZProgressLoading from 'z-progress-loading';
export default {
  components: {
    ZProgressLoading
  },
  // ...
}
</script>

Start

# 本地调试 localhost:3000
npm start # 或 npm run serve

# 编译 产物位于 dist 目录
npm run build

# 发布
npm run release

Params Config

  • progress: 传入进度,取值 0 - 100 之间;若不需要可始终传入 0 或 100。

  • start: 控制开始暂停。

  • config: 样式配置;elem 的概念是每一个小矩形;

    • renderer: 渲染方式,默认为 "dom",可选 "canvas"

    • elemWidth: 单个小矩形宽度

    • elemMinHeight: 小矩形最小高度

    • elemMaxHeight: 小矩形最大高度;最小最大高度相同时,将不会跳动

    • elemDeltaHeight: 初始时不同小矩形的高度差值

    • spacing: 小矩形间距;间距为 0 时将连成不间断的进度条

    • step: 小矩形跳动时高度变化的步长;默认为 1;值越大跳动时变化越快

    • bgColor: 未达到进度的小矩形颜色

    • foreColor: 已达到进度的小矩形颜色

    • lineCap: 线条裁切方式,默认为直角 "square",可选圆角 "round"

Recently Updated

Changelog available here.

License

The project is licensed under the terms of MIT license.

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.