1.0.1 • Published 5 years ago

cu-vue-skeleton v1.0.1

Weekly downloads
3
License
ISC
Repository
github
Last release
5 years ago

cu-vue-skeleton

cu骨架屏前端运行时插件

使用依赖

依赖cu-vue-skeleton-dev-plugin处理生成骨架屏后的项目

安装

npm i cu-vue-skeleton -S

使用

  • 为vue-router添加特性,页面切换时显示骨架过渡

    import { skeletonRouter } from 'cu-vue-skeleton'
    
    skeletonRouter(router, mainId)
    • router vue-router实例
    • mainId Vue实例挂载的页面元素id
  • 注入loading方法

    import { SkeletonPlugin } from 'cu-vue-skeleton'
    Vue.use(SkeletonPlugin, {
      mainId: 'app',
    })
    • mainId Vue实例挂载的页面元素id
    • 使用Vue全局方法
      Vue.showSkeletonLoading()
      Vue.hideSkeletonLoading()
    • 使用Vue实例方法
      this.$showSkeletonLoading()
      this.$hideSkeletonLoading()