摘要: ![](https://img2018.cnblogs.com/blog/1417762/201903/1417762-20190326145431990-1093417381.png) 阅读全文
posted @ 2019-03-26 14:55 木石天涯 阅读(106) 评论(0) 推荐(0) 编辑
摘要: 电话号码的字母组合 给定一个仅包含数字 2 9 的字符串,返回所有它能表示的字母组合。 给出数字到字母的映射如下(与电话按键相同)。注意 1 不对应任何字母。 示例: 输入:"23" 输出:["ad", "ae", "af", "bd", "be", "bf", "cd", "ce", "cf"]. 阅读全文
posted @ 2019-03-25 16:49 木石天涯 阅读(175) 评论(0) 推荐(0) 编辑
摘要: ES6 中的模块化语法 import / export 在浏览器或NodeJS环境中,是无法直接使用 import 语法的 在模块化的环境中每个JS文件都是一个独立的作用域,如果两个JS文件需要交互 那么,必须通过 导入和导出 才能实现 第一种语法: 导出:export default 要导出的内容 阅读全文
posted @ 2019-03-16 21:10 木石天涯 阅读(2154) 评论(0) 推荐(0) 编辑
摘要: ``` 首页 用户管理 const Home = { template: ` <h1 这是 Home 组件</h1 ` } // 父组件: const User = { template: ` <div class="user" <h2 用户中心</h2 <router link to="/user 阅读全文
posted @ 2019-03-14 17:02 木石天涯 阅读(880) 评论(0) 推荐(0) 编辑
摘要: 路由参数的说明 首页 学生 1 学生 2 // 路由参数: const Home = { template: ` <h1 这是 Home 组件</h1 ` } const Stu = { template: ` <div <p 这是第一个学生 {{ $route.params.id }} {{ na 阅读全文
posted @ 2019-03-14 16:38 木石天涯 阅读(975) 评论(0) 推荐(0) 编辑
摘要: 路由匹配展示的过程: + 当点击a标签(或者直接修改浏览器地址栏中的哈希值)会改变哈希值 + 当哈希值发生改变,Vue路由就会监听到这个变化 + 当路由监听到哈希值改变以后,就会用配置好的路由规则来匹配当前的哈希值 + 当哈希值被匹配成功,就会将当前路由规则对应的组件展示在页面中 router vi 阅读全文
posted @ 2019-03-14 15:07 木石天涯 阅读(7619) 评论(0) 推荐(1) 编辑
摘要: 路由的使用步骤: + 安装: npm i S vue router + 引入 vue router + 创建路由规则 + 将路由实例与vue实例关联到一起 + 配置路由规则 哈希值 和 组件 的对应关系 + 指定路由出口( 表示将当前匹配的路由展示在页面中的哪个位置 ) <! 入口:实际上就是一个a 阅读全文
posted @ 2019-03-14 14:47 木石天涯 阅读(1153) 评论(0) 推荐(0) 编辑
摘要: a标签的锚点值是用来实现:页面内部跳转 1 ajax 2 哈希值(锚点)的使用(window.location.hash ) 3 hashchange 事件 <!DOCTYPE html Document div { height: 500px; width: 100%; background co 阅读全文
posted @ 2019-03-14 11:24 木石天涯 阅读(260) 评论(0) 推荐(0) 编辑
摘要: ``` <!DOCTYPE html Document / 容器 / .container { width: 150px; } / 灯 / .light { width: 100px; height: 100px; border radius: 50%; text align: center; li 阅读全文
posted @ 2019-03-14 10:26 木石天涯 阅读(433) 评论(0) 推荐(0) 编辑
摘要: ``` <! 1 给属性添加 .sync 修饰符 // 2 props 是只读的,不能修改。 // 不能修改是说:不能重新赋值 const vm = new Vue({ el: ' app', data: { msg: 'parent data' }, components: { child: { 阅读全文
posted @ 2019-03-14 09:47 木石天涯 阅读(289) 评论(0) 推荐(0) 编辑