vue.js如何安装vuex


当前第2页 返回上一页

  导入store,然后再new Vue中使用,代码如下:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

// The Vue build version to load with the `import` command

// (runtime-only or standalone) has been set in webpack.base.conf with an alias.

import Vue from 'vue'

import App from './App'

import router from './router'

import store from './store'   //导入store

Vue.config.productionTip = false

/* eslint-disable no-new */

new Vue({

  el: '#app',

  router,

  store,   //在new Vue中使用

  components: { App },

  template: '<App/>'

})

相关免费学习推荐:javascript(视频)

以上就是vue.js如何安装vuex的详细内容,更多文章请关注木庄网络博客

返回前面的内容

相关阅读 >>

vue.js中怎么添加图片

vue.js有什么优点

vue.js与其它框架的不同是什么

如何安装vue.js devtools?

vue.js如何安装jq

vue.js中指令的作用是什么?

vue.js和安装有什么区别

详解vue.js中watch的使用

vue.js怎么改端口号

vue.js的ul-li标签仿select标签

更多相关阅读请进入《vue.js》频道 >>




打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...