一些相关库的简单介绍

2018-10-25  本文已影响0人  蓝Renly

1.vue-cli

1.1.安装

npm installn -g vue-cli@version 

1.2.创建项目,通过脚手架的方式

vue init webpack projectName

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.

https://github.com/vuejs/vuex

主要是在页面之间跳转时,需要传输数据时,需要使用vuex,可以理解为一个定义全局变量;

1.5.axios

安装

npm install axios

用来请求数据

上一篇下一篇

猜你喜欢

热点阅读