Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

加个nprogress #1795

Open
ST-log opened this issue Oct 10, 2024 · 1 comment
Open

加个nprogress #1795

ST-log opened this issue Oct 10, 2024 · 1 comment

Comments

@ST-log
Copy link

ST-log commented Oct 10, 2024

Feature request 🚀

router文件是这样加nprogress 来实现进度效果么

Expected:

  • No breaking changes

Examples:

import routes from '~pages'
// @ts-ignore
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'
import { createRouter, createWebHashHistory, Router } from 'vue-router'
const router: Router = createRouter({
  history: createWebHashHistory(),
  routes: [
    {
      path: '/',
      redirect: '/layout/h5'
    },
    ...routes
  ]
})
router.beforeEach((to, from, next) => {
  NProgress.start()
  next()
  NProgress.done()
})
export default router

Programme:

Others:

@haoziqaq
Copy link
Member

我不确定你这边的问题是否和本仓库有关,如果你是想问 varlet 有没有类似 NProgress 的组件的话,答案是有的。
https://varletjs.org/#/zh-CN/loading-bar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants