07 2020 档案
摘要:满足以下几点机即可: input type="search" 放到form标签中 使用action属性 <form action="." > <input type='search' /> </form> 注意: 如果只使用input type="search",而不放到form标签中,则显示“换行
阅读全文
摘要:利用ref属性//父组件 <template> <div class="home"> <HelloWorld ref="mychild"></HelloWorld> <div @click="clickParent">click me</div> </div> </template> <script
阅读全文
摘要:Vue中子组件调用父组件的方法,这里有三种方法提供参考 第一种方法是直接在子组件中通过this.$parent.event来调用父组件的方法 父组件 <template> <div> <child></child> </div> </template> <script> import child f
阅读全文
摘要:<html lang="en" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8" /> <title></title> </head> <body> </body> </html> <script type="tex
阅读全文
摘要:设置右边元素flex:1,当右边元素宽度超过父元素时,会造成右边宽度溢出。 右边多设置一个width:0或overflow:hiddlen后样式正常。 为什么设置flex: 1可以实现宽度自适应? 这与flex属性的赋值语法有关,CSS属性 flex 规定了弹性元素如何伸长或缩短以适应flex容器中
阅读全文
摘要:1.await 只能出现在 async 函数中 2. await 等到了它要等的东西,一个 Promise 对象,或者其它值,然后呢?我不得不先说,await 是个运算符,用于组成表达式,await 表达式的运算结果取决于它等的东西。 如果它等到的不是一个 Promise 对象,那 await 表达
阅读全文
摘要: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
阅读全文
摘要:// 获取省 getSheng() { return new Promise((resolve, reject) => { axios.get(BASEURL + '/phone/Controllers/', { params: { _action: "1bd2b39b-c393-4dc9-81e3
阅读全文