Code Monkey home page Code Monkey logo

vue-ins-progress-bar's Introduction

slogan

vue-ins-progress-bar

license npm downloads ts

a vue component of ins-style progress bar

一款 ins 风格的 vue 进度条组件

Demo

Live Demo

Install

$ npm i vue-ins-progress-bar   

Usage

main.js

import VueInsProgressBar from 'vue-ins-progress-bar'

const options = {
  position: 'fixed',
  show: true,
  height: '3px'
}

Vue.use(VueInsProgressBar, options)

App.vue

<template>
  <div id="app">
    <router-view/>
    <vue-ins-progress-bar></vue-ins-progress-bar>
  </div>
</template>

<script>
export default {
  name: 'App',
  mounted () {
    this.$insProgress.finish()
  },
  created () {
    this.$insProgress.start()

    this.$router.beforeEach((to, from, next) => {
      this.$insProgress.start()
      next()
    })

    this.$router.afterEach((to, from) => {
      this.$insProgress.finish()
    })
  }
}
</script>

APIs

this.$insProgress.start() // start the loading
this.$insProgress.finish() // finish the loading
this.$insProgress.height(4) // resize the height of loading bar to 4px

Browsers Support

Modern browsers and Internet Explorer 9+ (IE9 purple)

Source

Repository: vue-ins-progress-bar      

Contributors: contributors

Author: meloalright

Popularity

downloads

ChangeLog

Documented in Releases

License

MIT

vue-ins-progress-bar's People

Contributors

meloalright avatar tangyouge avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vue-ins-progress-bar's Issues

Not working on Vue3 CLI with TS

Hi,

I really love your progress bar, but have tried so many things and I just cannot get it to work.

This is the error I am getting in the console;

TypeError: Object is not a constructor

Could not find a declaration file for module

i got this issue
screenshot from 2018-09-29 23-10-35
but when i check the node modules i find every thing fine but it still returns 'undefined'
and when i run
npm install @types/vue-ins-progress-bar
it returns
npm ERR! code E404 npm ERR! 404 Not Found: @types/vue-ins-progress-bar@latest

Change the loading time

Hello, i now that we can call the start and the finish of the loading bar but i need a smooth way to do that, i have to make some api calls and it isn't a fixed response time so i need to display that animation in a different time than default. How can i do that?
Thanks in advance,
André Luiz

欢迎贡献者~ contributions welcome

欢迎贡献者~ contributions welcome

组件的定位是 vue + ins style + progress bar,所以仅针对 vue 项目作为 vue component 支持,暂时不会支持 React / Angular 版本或者 <script> 标签 引入方式。

This component is based for vue + ins style + progress bar, so it will only support for vue projects as a vue component, we will not support React / Angular import or <script> import.

欢迎为本项目贡献代码,尤其是解决 issues 中的问题。欢迎 Fork 本项目并提交 Pull Request,而且最好要在 gh-pages 分支验证通过~

Contributions welcome, especially for resolving the problems in issues. Just fork and create pull request, and you' d better have a try at gh-pages at the end~

感谢贡献者 Thanks for Contributors: @tangyouge

demo代码直接拷贝的,报错

webpack-internal:///./node_modules/core-js/modules/es6.promise.js:110 Unhandled promise rejection TypeError: Cannot read property 'finish' of undefined

TypeError: Cannot read property 'start' of undefined

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.