博客
关于我
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/

    你可能感兴趣的文章
    openlayers 入门教程(十四):第三方插件
    查看>>
    openlayers 入门教程(四):layers 篇
    查看>>
    OpenLayers 项目分析(三)-OpenLayers中定制JavaScript内置类
    查看>>
    Openlayers中使用Cluster实现点位元素重合时动态聚合与取消聚合
    查看>>
    Openlayers中使用Cluster实现缩放地图时图层聚合与取消聚合
    查看>>
    Openlayers中使用Image的rotation实现车辆定位导航带转角(判断车辆图片旋转角度)
    查看>>
    Openlayers中加载Geoserver切割的EPSG:900913离线瓦片图层组
    查看>>
    Openlayers中将某个feature置于最上层
    查看>>
    Openlayers中点击地图获取坐标并输出
    查看>>
    Openlayers中设置定时绘制和清理直线图层
    查看>>
    Openlayers图文版实战,vue项目从0到1做基础配置
    查看>>
    Openlayers实战:modifystart、modifyend互动示例
    查看>>
    Openlayers实战:判断共享单车是否在电子围栏内
    查看>>
    Openlayers实战:加载Bing地图
    查看>>
    Openlayers实战:绘制图形,导出geojson文件
    查看>>
    Openlayers实战:绘制图形,导出KML文件
    查看>>
    Openlayers实战:绘制多边形,导出CSV文件
    查看>>
    Openlayers实战:绘制带箭头的线
    查看>>
    Openlayers实战:输入WKT数据,输出GML、Polyline、GeoJSON格式数据
    查看>>
    Openlayers高级交互(10/20):绘制矩形,截取对应部分的地图并保存
    查看>>