上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 24 下一页
摘要: let arr = [10,4,5,77,23,45]; for(let j=0;j<arr.length-1;j++){//外层循环,控制趟数,每一次找到一个最大值 for(let i=0;i<arr.length-1-j;i++){// 内层循环,控制比较的次数,并且判断两个数的大小 if(ar 阅读全文
posted @ 2020-08-28 23:16 炽橙子 阅读(607) 评论(0) 推荐(0) 编辑
摘要: 1.因为官网图片太多,服务器带宽又不够,导致网页加载很慢。20几秒 打算把图片放到七牛云,发现七牛云需要域名备案,(后面七牛云回访说可以提交工单申请国外的对象存储不用备案。) 后面决定放到腾讯云的cos上,有提供域名。有活动50g存储空间,6个月免费,流量不算免费。 2.静态图片,直接上传到腾讯云的 阅读全文
posted @ 2020-08-27 11:26 炽橙子 阅读(334) 评论(0) 推荐(0) 编辑
摘要: 满足以下几点机即可: input type="search" 放到form标签中 使用action属性 <form action="." > <input type='search' /> </form> 注意: 如果只使用input type="search",而不放到form标签中,则显示“换行 阅读全文
posted @ 2020-07-31 09:15 炽橙子 阅读(1023) 评论(0) 推荐(0) 编辑
摘要: 利用ref属性//父组件 <template> <div class="home"> <HelloWorld ref="mychild"></HelloWorld> <div @click="clickParent">click me</div> </div> </template> <script 阅读全文
posted @ 2020-07-29 11:41 炽橙子 阅读(9523) 评论(0) 推荐(1) 编辑
摘要: Vue中子组件调用父组件的方法,这里有三种方法提供参考 第一种方法是直接在子组件中通过this.$parent.event来调用父组件的方法 父组件 <template> <div> <child></child> </div> </template> <script> import child f 阅读全文
posted @ 2020-07-29 11:39 炽橙子 阅读(292) 评论(0) 推荐(0) 编辑
摘要: <html lang="en" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8" /> <title></title> </head> <body> </body> </html> <script type="tex 阅读全文
posted @ 2020-07-18 09:44 炽橙子 阅读(3471) 评论(0) 推荐(0) 编辑
摘要: 设置右边元素flex:1,当右边元素宽度超过父元素时,会造成右边宽度溢出。 右边多设置一个width:0或overflow:hiddlen后样式正常。 为什么设置flex: 1可以实现宽度自适应? 这与flex属性的赋值语法有关,CSS属性 flex 规定了弹性元素如何伸长或缩短以适应flex容器中 阅读全文
posted @ 2020-07-17 10:15 炽橙子 阅读(10929) 评论(1) 推荐(0) 编辑
摘要: 1.await 只能出现在 async 函数中 2. await 等到了它要等的东西,一个 Promise 对象,或者其它值,然后呢?我不得不先说,await 是个运算符,用于组成表达式,await 表达式的运算结果取决于它等的东西。 如果它等到的不是一个 Promise 对象,那 await 表达 阅读全文
posted @ 2020-07-14 16:16 炽橙子 阅读(356) 评论(0) 推荐(0) 编辑
摘要: 1.结论:forEach、map不支持异步变同步。 let arr=[1,2,3,4,5]; function asyncEvent(ele){ return new Promise(resolve=>{ setTimeout(e=>{ console.log(e); resolve(e) },10 阅读全文
posted @ 2020-07-14 15:41 炽橙子 阅读(2143) 评论(0) 推荐(0) 编辑
摘要: // 获取省 getSheng() { return new Promise((resolve, reject) => { axios.get(BASEURL + '/phone/Controllers/', { params: { _action: "1bd2b39b-c393-4dc9-81e3 阅读全文
posted @ 2020-07-10 10:45 炽橙子 阅读(1068) 评论(0) 推荐(0) 编辑
上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 24 下一页