1.vue-cli
1.1.安装
npm installn -g vue-cli@version
1.2.创建项目,通过脚手架的方式
vue init webpack projectName
- 注意:vue-cl的3.0版本创建项目关键字已经改为create了;
1.3.Vue-Router
当前路由对应的组件
<router-view/>
<router-link to="要跳转去的组件的路径">
也可以使用下面方式跳转路径
this.$router.push('/path')
1.4.vuex
官网上如此介绍:
What is Vuex?
Vuex is a state management pattern + library for Vue.js applications. It serves as a centralized store for all the components in an application, with rules ensuring that the state can only be mutated in a predictable fashion. It also integrates with Vue's official devtools extension to provide advanced features such as zero-config time-travel debugging and state snapshot export / import.
主要是在页面之间跳转时,需要传输数据时,需要使用vuex,可以理解为一个定义全局变量;
1.5.axios
安装
npm install axios
用来请求数据
网友评论