摘要: 继上一篇vue环境的搭建(在D盘新建文件夹vue_cli,把(我已经上传到了文件下)资料下tpls解压完后的所有文件都复制到D盘vue_cli下) 目录如图: 1、webstorm设置为了提高webStrom在Vue项目中响应速度,设置:选中项目,点击右键,mark directory as,exc 阅读全文
posted @ 2017-11-06 10:46 匿名的girl 阅读(9599) 评论(0) 推荐(0) 编辑
摘要: 二、综合组件之间的通信 实现一个ToDoList。 ①完成所有的组件的创建和使用 ②add点击add按钮时候,将用户输入的内容(todoinput),显示在(todolist) 核心代码:兄弟组件间通信 步骤1:var bus = new Vue() 步骤2:在准备接受数据的组件 bus.$on(' 阅读全文
posted @ 2017-11-03 17:53 匿名的girl 阅读(357) 评论(0) 推荐(0) 编辑
摘要: fake api:http://jsonplaceholder.typicode.com/posts方便对于网络模块做测试。 正常情况,需要公司的服务器。 一、网络请求需要vue-resource.js插件 this.$http .get('url') .then(function(response 阅读全文
posted @ 2017-11-03 15:35 匿名的girl 阅读(261) 评论(0) 推荐(0) 编辑
摘要: 要使用vue来开发前端框架,首先要有环境,这个环境要借助于node,所以要先安装node,借助于node里面的npm来安装需要的依赖等等。 ①安装nodejshttps://nodejs.org 下载nodejs,(lts)安装的时候,点击同意,一路next就可以。会自带一个npm(npm是个包管理 阅读全文
posted @ 2017-11-03 11:57 匿名的girl 阅读(365) 评论(1) 推荐(0) 编辑
摘要: 路由嵌套的SPA实现的步骤: A(/a)组件需要嵌套B组件(/b)和C组件(/c) ①准备嵌套其它组价的父组件 指定一个容器在A组件指定一个容器<router-view></router-ivew> ②在A组件的路由配置对象中指定children属性{ path:'/a', component:A, 阅读全文
posted @ 2017-11-03 10:22 匿名的girl 阅读(398) 评论(0) 推荐(0) 编辑
摘要: 五、路由设置高级用法alias 别名 {path:'/list',component:MyList,alias:'/lists'}redirect 重定向 {path:'/productList',redirect:'/list'}path:'*' 异常处理 {path:'*',component: 阅读全文
posted @ 2017-11-03 09:42 匿名的girl 阅读(1635) 评论(0) 推荐(0) 编辑
摘要: 四、通过VueRouter来实现组件之间的跳转:参数的传递 login 用户名 >main ①明确发送方和接收方②配置接收方的路由地址 {path:'/myTest',component:TestComponent} --> {path:'/myTest/:id',component:TestCom 阅读全文
posted @ 2017-11-02 21:00 匿名的girl 阅读(3238) 评论(0) 推荐(0) 编辑
摘要: 三、通过VueRouter来实现组件之间的跳转提供了3种方式实现跳转:①直接修改地址栏中的路由地址 ②通过router-link实现跳转<router-link to="/myRegister">注册</router-link> ③通过js的编程的方式 jumpToLogin: function ( 阅读全文
posted @ 2017-11-02 19:57 匿名的girl 阅读(5214) 评论(0) 推荐(0) 编辑
摘要: 一、SPA的概述 SPA(single page application)单页面应用程序,在一个完成的应用或者站点中,只有一个完整的html页面,这个页面有一个容器,可以把需要加载的代码片段插入到该容器中。 SPA的工作原理: eg: http://127.0.0.1/index.html#/sta 阅读全文
posted @ 2017-11-02 17:30 匿名的girl 阅读(3096) 评论(0) 推荐(1) 编辑
摘要: 总结:父组件--》子组件 ①通过属性 步骤1: <son myName="michael" myPhone='123'></son> <son :myName="userList[0]"></son> 步骤2: Vue.component('son',{ props:['myName','myPho 阅读全文
posted @ 2017-11-02 16:39 匿名的girl 阅读(5302) 评论(1) 推荐(0) 编辑