vue3与vue2区别路由
时间: 2023-08-20 14:12:20 浏览: 54
Vue3与Vue2在路由方面的主要区别在于使用的路由库不同。在Vue2中,通常使用Vue Router作为路由库,而在Vue3中,Vue Router仍然是官方推荐的路由库,但也可以选择使用新的路由库 - Vue Router Next。\[2\]在安装Vue Router时,Vue2.0采用的版本为@^3.5.1,可以通过npm i vue-router@^3.5.1 -s进行安装。\[1\]而在Vue3中,可以直接使用npm i vue-router -s进行安装,这将安装最新版本的Vue Router(适用于Vue3)。\[3\]所以,Vue3与Vue2在路由方面的主要区别在于安装方式和使用的路由库。
#### 引用[.reference_title]
- *1* *3* [Vue的路由配置(Vue2和Vue3的路由配置)](https://blog.csdn.net/weixin_46022934/article/details/125744089)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [vue2和vue3中路由的区别和写法?](https://blog.csdn.net/XU441520/article/details/129525102)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![-](https://csdnimg.cn/download_wenku/file_type_column_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)