How to use the iview.LoadingBar function in iview

To help you get started, we’ve selected a few iview examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github FlowzPlatform / workflow / client / src / main.js View on Github external
router.beforeEach((to, from, next) => {
  iView.LoadingBar.start()
  iView.LoadingBar.config({ color: '#0e406d' })
    // window.console.log('Transition', transition)
    // router.app.$store.state.token
  let obId = false
  let location = psl.parse(window.location.hostname) // get parent domain
  location = location.domain === null ? location.input : location.domain
  if (to.query.ob_id) {
    // let location = psl.parse(window.location.hostname) // get parent domain
    // location = location.domain === null ? location.input : location.domain
    // router.app.$cookie.set('auth_token', to.query.ob_id, { expires: 1, domain: location })
    obId = to.query.ob_id
  }
  if (to.query.token) {
    router.app.$cookie.set('auth_token', to.query.token, { expires: 1, domain: location })
  }
  const token = router.app.$cookie.get('auth_token')
  store.state.token = token
github 417511458 / jbone / jbone-cms / jbone-cms-admin / src / router / index.js View on Github external
router.beforeEach((to, from, next) => {

  iView.LoadingBar.start();
  // to.param;

  let code = to.query.code
  handleAuth(code, () => {
    if(to.name === LOGIN_PAGE_NAME){
      next({
        name: homeName // 跳转到homeName页
      })
    }else{
      next();
    }
  })

  
  
  // if (!token && to.name !== LOGIN_PAGE_NAME) {
github garenchan / silly-blog / frontend / src / router / index.js View on Github external
router.beforeEach((to, from, next) => {
  iView.LoadingBar.start()
  const token = getToken()
  const loginRequired = to.name === HOME_PAGE || to.name.startsWith('admin') || to.name.startsWith('user')
  if (!token && loginRequired) {
    next({
      name: LOGIN_PAGE_NAME, // 跳转到登录页
      query: {
        next: to.name
      }
    })
  } else if (token && loginRequired) {
    store.dispatch('getUserInfo').then(user => {
      if (canTurnTo(to.name, user.role, routes)) {
        next() // 有权限,可访问
      } else next({ replace: true, name: 'error_401' }) // 无权限,重定向到401页面
    })
  } else if (!token && to.name === LOGIN_PAGE_NAME) {
github virjar / vscrawler / vscrawler-frontend / src / service / method.js View on Github external
.then((response) => {
          if (response.data) {
            resolve(response.data)
            iView.LoadingBar.finish()
          }
        })
        .catch((error) => {
github IceInTheFire / timotaoshu / iview-admin-dev / src / router / index.js View on Github external
router.afterEach((to) => {
    Util.openNewPage(router.app, to.name, to.params, to.query);
    iView.LoadingBar.finish();
    window.scrollTo(0, 0);
});
github ejfrancis / Meteor-Vue-Enterprise-Starter / src / imports / modules / router / client / lib / router.js View on Github external
router.beforeEach((to, from, next) => {
    iView.LoadingBar.start();
    next();
  });
  router.afterEach((to, from) => {
github garenchan / silly-blog / frontend / src / router / index.js View on Github external
router.afterEach(to => {
  iView.LoadingBar.finish()
  window.scrollTo(0, 0)
})
github aspnetboilerplate / module-zero-core-template / vue / src / router / index.ts View on Github external
router.beforeEach((to, from, next) => {
    iView.LoadingBar.start();
    Util.title(to.meta.title);
    if (Cookies.get('locking') === '1' && to.name !== 'locking') {
        next({
            replace: true,
            name: 'locking'
        });
    }else if (Cookies.get('locking') === '0' && to.name === 'locking') {
        next(false);
    } else {
        if (!Util.abp.session.userId&& to.name !== 'login') {
            next({
                name: 'login'
            });
        } else if (!!Util.abp.session.userId && to.name === 'login') {
            Util.title(to.meta.title);
            next({
github fengjinqi / website-admin / src / router / index.js View on Github external
router.afterEach(to => {
  setTitle(to, router.app)
  iView.LoadingBar.finish()
  window.scrollTo(0, 0)
})
github easy-mock / easy-mock / views / api / index.js View on Github external
done () {
    this.count = 0
    this.isLoading = false
    iView.LoadingBar.finish()
  },
  checkLoading () {