摘要: 问题:一只青蛙一次可以跳上1级台阶,也可以跳上2级台阶。求该青蛙跳上一个 n 级的台阶总共有多少种跳法。 分析:到达n层的方法数目 = 到达n-1层的方法数 + 最后一次跳1层 或者到达 n-2层的方法数 + 最后一次跳2层。即 f(n) = f(n-1) + f(n-2) f(1) = 1 f(2 阅读全文
posted @ 2021-03-21 23:07 why_not_try 阅读(42) 评论(0) 推荐(0) 编辑
摘要: 代码如下: let a = 1, b = 10 a = a + b - (b = a) console.log('first: ', a, b) a = a ^ b b = a ^ b a = b ^ a console.log('second: ', a, b) a = {a, b} b = a. 阅读全文
posted @ 2021-03-21 22:05 why_not_try 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 代码如下:原理是设置宽高为0,只设置border-style:solid和border-width、border一个的颜色。这时得到的效果就是一个三角形,如果位置不对,可以用rotate进行角度转化。 代码如下: <!DOCTYPE html> <html lang="en"> <head> <me 阅读全文
posted @ 2021-03-18 10:21 why_not_try 阅读(127) 评论(0) 推荐(0) 编辑
摘要: JSON:JavaScript Object Notation(JavaScript对象表示法);甚至我们就可以大致认为JSON就是Javascript的对象,只不过范围小上一些。 JSON的MIME类型是"application/json" JSON.parse(text[,reviver]) [ 阅读全文
posted @ 2018-10-30 19:35 why_not_try 阅读(194) 评论(0) 推荐(0) 编辑
摘要: 1 <template> 2 <div> 3 <h2>this is from C.vue</h2> 4 </div> 5 </template> 6 7 <script> 8 export default { 9 name: 'C', 10 data () { 11 return { 12 msg 阅读全文
posted @ 2018-10-29 20:58 why_not_try 阅读(369) 评论(0) 推荐(0) 编辑
摘要: 1 <template> 2 <div> 3 this is A.vue <br> 4 <!--计算属性--> 5 <label for="msg">输入message:</label> 6 <input type="text" v-model="message" id="msg"> 7 <div> 阅读全文
posted @ 2018-10-25 19:48 why_not_try 阅读(240) 评论(0) 推荐(0) 编辑
摘要: 1 <template> 2 <div class="home-wrapper"> 3 <div class="home-top">this is from Home.vue</div> 4 <!--num>10,背景颜色红色,否则橙色--> 5 <div class="test" :class=" 阅读全文
posted @ 2018-10-25 18:50 why_not_try 阅读(2641) 评论(0) 推荐(0) 编辑
摘要: 如下图: 阅读全文
posted @ 2018-10-05 16:08 why_not_try 阅读(1809) 评论(0) 推荐(0) 编辑
摘要: 代码如下: 1 <!DOCTYPE html> 2 <html lang="en"> 3 <head> 4 <meta charset="UTF-8"> 5 <title>创建对象的模式</title> 6 <meta name="viewport" content="width=device-wi 阅读全文
posted @ 2018-05-27 21:48 why_not_try 阅读(209) 评论(0) 推荐(0) 编辑
摘要: 上代码: 1 <!DOCTYPE html> 2 <html lang="en"> 3 <head> 4 <meta charset="UTF-8"> 5 <title>vue6</title> 6 <meta name="viewport" content="width=device-width, 阅读全文
posted @ 2018-05-12 20:34 why_not_try 阅读(236) 评论(0) 推荐(0) 编辑