node.js - nodejs+express+vue
天蓬老师
天蓬老师 2017-04-17 15:03:36
0
3
794

如果用nodejs+express+vue.js开发的
要怎么选择路由?是选择express提供的路由还是vue.js提供的路由

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all(3)
Peter_Zhu

Although they are both called routing, their starting points are different!
Express routing is normal routing from domain.com/users
, while vuejs routing is from domain.com/#users
# is the root of vuejs and the root of express is / (of course all back-end languages The roots are also /)

express example (get user information):
domain.com/users/1000

vuejs example (get user information)
domain.com/#users/1000

PHPzhong

What the two don’t want to do is that vue’s routing is front-end routing, which is the routing in single-page applications. The route in express is the path to the file or api interface on the server.

Ty80

Vue is a front-end routing, express is a back-end routing, and the idea of ​​​​vue is to separate the front and back ends. The back end only needs to provide the index.html entry, and other data is obtained through express's routing interface

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