不用延迟加载 刷新页面报错
Open
- Dominant language
- Vue
- Stars
- 16.3k
- Forks
- 4.7k
- PR merge metrics
- No merged PRs in 30d
Description
### 路由文件router.js中比如 将
#### component: () => import('@/views/home/home.vue')
### 改为
`import home from '@/views/home/home.vue'`
`component: home`
直接刷新http://localhost:8081/#/home 页面js报错
```
TypeError: Cannot read property 'state' of undefined
at Object../src/libs/util.js.util.openNewPage
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in router.js with the non-lazy home route, then inspect src/libs/util.js at util.openNewPage. Reproduce the refresh at http://localhost:8081/#/home and compare it with the lazy-loaded route. Done means refreshing the non-lazy route no longer raises the reported state error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100