javascript - webpack compiles vue project and throws a warning. This has not happened before
phpcn_u1582
phpcn_u1582 2017-07-05 11:00:24
0
1
1076

The error message is as follows:
Critical dependency: the request of a dependency is an expression

The routing code is as follows:

routes: [
    {
      path: '/login',
      name: 'login',
      component: resolve => require(['./../views/login/login.vue', resolve])
    },
    {
      path: '/404',
      name: '404',
      component: resolve => require(['./../views/404.vue', resolve])
    }
  ]

I have written this before, but this has never happened. Please solve it

phpcn_u1582
phpcn_u1582

reply all(1)
刘奇

There is indeed nothing wrong with writing it this way. It may be that the warning mechanism has been changed in the version update.
Expressions can be made into constants for easy reading and modification

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template