摘要: 第一种方法:浮动 <section class="layout float"> <style type="text/css"> .layout.float .left{ float: left; width: 300px; background: red; } .layout.float .righ 阅读全文
posted @ 2018-07-30 19:57 Goff956 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 三部分 const router = new Router({}) router.beforeEach(function (to,from,next) {} // export default router 3. 未完待续 阅读全文
posted @ 2018-07-30 19:51 Goff956 阅读(106) 评论(0) 推荐(0) 编辑
摘要: 1. 动态路由匹配 /home/123456 > resFul > params /home?room_id=123456 > query (1) resFul (1.1) 通过$route.params获取id <div>房间号:{{$route.params.id}}</div> <div>成员 阅读全文
posted @ 2018-07-30 19:49 Goff956 阅读(78) 评论(0) 推荐(0) 编辑
摘要: 构建项目 vue init webpack vue-router-demo cnpm install 使用vue-router 1. 在src文件夹下 -- 新建router文件夹 -- 新建index.js 2. 在index.js中引入vue、vue-router import Vue from 阅读全文
posted @ 2018-07-30 19:46 Goff956 阅读(117) 评论(0) 推荐(0) 编辑
摘要: vue init webpack vue-vuex 创建vuex项目 cnpm install 安装依赖 cnpm install vuex --save 安装vuex包 import Vuex from 'vuex' 引入vuex插件 Vue.use(Vuex) 使用vuex插件 在scr文件夹下 阅读全文
posted @ 2018-07-30 19:44 Goff956 阅读(117) 评论(0) 推荐(0) 编辑
摘要: transition .v-enter{} 当前组件刚进入时的样式 .v-enter-to{} 当前组件进入完成的样式 .v-enter-active{} 当前组件进入的过程中的样式 .v-leave 当前组件离开时的样式 .v-leave-to 当前组件离开完成时的样式 .v-leave-acti 阅读全文
posted @ 2018-07-30 19:39 Goff956 阅读(143) 评论(0) 推荐(0) 编辑
摘要: computed 计算属性(派生值,附加值) 基于原来的属性,对数据进行处理,不改变原数据 阅读全文
posted @ 2018-07-30 19:37 Goff956 阅读(230) 评论(0) 推荐(0) 编辑
摘要: props 通过 v-bind 方法进行通信 通过 :newmsg 获取 msg 的值 > props 定义 newmsg > 子组件用 newmsg 就可以获得父级的 msg 了 default 与 require 一般不并用 default: 默认值 require:是否需要传值 单项数据流 通 阅读全文
posted @ 2018-07-30 19:36 Goff956 阅读(314) 评论(0) 推荐(0) 编辑
摘要: v-bind:class 可以简写成 :class 对象 :class = {} class 的值由 key 组成, 但是由value决定 数组 :class = [] class 是由数组中每一项对应的值决定 :style :type v-model 双向数据绑定 模拟 v-model 阅读全文
posted @ 2018-07-30 19:34 Goff956 阅读(64) 评论(0) 推荐(0) 编辑
摘要: v-if : 真正的渲染 v-show : 通过改变 css 样式 display 来实现是否显示 v-show 的性能好一些 v-on:keyup.enter (.enter键值修饰符) class id type style reayonly data-xxx :class={} class 的 阅读全文
posted @ 2018-07-30 18:47 Goff956 阅读(87) 评论(0) 推荐(0) 编辑