随笔分类 -  Vue学习笔记

摘要:1、安装vue-resource扩展: npm install vue-resource 2、在main.js中引入 3、使用方法 4、使用拦截器显示和隐藏loading效果 (需要用到vuex扩展,vuex使用方法戳这里) store.js 代码 main.js 代码 新建Loading.vue 阅读全文
posted @ 2017-08-04 14:29 L狗哥 阅读(693) 评论(0) 推荐(0)
摘要:1、安装vuex扩展 : npm install vuex 2、在componets目录下新建 store.js 文件 属性值介绍: state:定义初始值 getters:获取变量值 mutations: 定义触发状态对象方法,传入state整个对象,在页面中触发时使用this.$store.co 阅读全文
posted @ 2017-08-04 12:19 L狗哥 阅读(372) 评论(0) 推荐(0)
摘要:1、在 src/router/index.js 里定义新的路由数据 HTML5 history 模式配置 Apache Nginx Nodejs Express 2、在需要跳转的页面添加代码 阅读全文
posted @ 2017-08-03 19:02 L狗哥 阅读(170) 评论(0) 推荐(0)
摘要:1、在components 目录下新建Test.vue 文件 2、在Hell.vue里添加代码引用Test.vue 运行结果: 阅读全文
posted @ 2017-08-03 18:02 L狗哥 阅读(544) 评论(0) 推荐(0)
摘要:1、需要nodejs 环境支持。 2、安装 cnpm 替换npm镜像为国内镜像 3、全局安装vue 4、新建项目 5、安装依赖并运行 6、打包 7、目录结构 阅读全文
posted @ 2017-08-03 17:48 L狗哥 阅读(178) 评论(0) 推荐(0)