博客
关于我
vue结合nprogress如何添加响应进度条的效果
阅读量:370 次
发布时间:2019-03-05

本文共 707 字,大约阅读时间需要 2 分钟。

??vue ?? nprogress ????????

?????????????????????????????????????nprogress ??????????????????? Vue ?????????????????? Vue ????? nprogress ????????

  • ??????? npm ?? nprogress ??????????????????
  • npm install --save nprogress
  • ???????? nprogress ???????????????? nprogress ?????? CSS ???
  • import NProgress from 'nprogress'
    import 'nprogress/nprogress.css'
  • ?????????? nprogress ??????? Vue ???????? axios ?????????????????
  • axios.interceptors.request.use(config => {    NProgress.start()    config.headers.Authorization = window.sessionStorage.getItem('token')    return config  })
  • ?????????? nprogress ?????????????? axios ????????
  • axios.interceptors.response.use(config => {    NProgress.done()    return config  })

    转载地址:http://pcpg.baihongyu.com/

    你可能感兴趣的文章
    netty底层源码探究:启动流程;EventLoop中的selector、线程、任务队列;监听处理accept、read事件流程;
    查看>>
    Netty核心模块组件
    查看>>
    Netty框架的服务端开发中创建EventLoopGroup对象时线程数量源码解析
    查看>>
    Netty源码—2.Reactor线程模型一
    查看>>
    Netty源码—4.客户端接入流程一
    查看>>
    Netty源码—4.客户端接入流程二
    查看>>
    Netty源码—5.Pipeline和Handler一
    查看>>
    Netty源码—6.ByteBuf原理二
    查看>>
    Netty源码—7.ByteBuf原理三
    查看>>
    Netty源码—7.ByteBuf原理四
    查看>>
    Netty源码—8.编解码原理二
    查看>>
    Netty源码解读
    查看>>
    Netty的Socket编程详解-搭建服务端与客户端并进行数据传输
    查看>>
    Netty相关
    查看>>
    Network Dissection:Quantifying Interpretability of Deep Visual Representations(深层视觉表征的量化解释)
    查看>>
    Network Sniffer and Connection Analyzer
    查看>>
    Net与Flex入门
    查看>>
    net包之IPConn
    查看>>
    NFinal学习笔记 02—NFinalBuild
    查看>>
    NFS共享文件系统搭建
    查看>>