Vue.js project combat: Ant Design Pro open source projects to build large-scale practice notes (2)

A highly scalable routing design

1. pit

On one of my ant-design-pro practical note, the recording process I set to introduce on-demand, but this time I again App.vue content back to the global introduction: Here Insert Picture Description
this run error in the browser:main.js?56d7:9 Uncaught ReferenceError: Antd is not defined

Solution: back to the introduction of on-demand

2. Routing lazy loading (loading asynchronous) manner introduction meansHere Insert Picture Description

Read Vue specific official document: Link .

3. Redirect page:Here Insert Picture Description

Page will when accessing / user, it will be automatically redirected to the / user / login

4. Jump page progress bar effect

  • installation:npm i nprogress

  • In router.js file:

    import NProgress from "nprogress";

    import 'nprogress/nprogress.css';Here Insert Picture Description

Published 33 original articles · won praise 73 · views 2783

Guess you like

Origin blog.csdn.net/weixin_46124214/article/details/104148959