摘要:1.原型和原型链2.继承3.闭包4.Promise的用法,promise.all的使用5. vue异步获取到数据,到渲染,这个过程的原理6. 把一个url转换成一个对象7. 如何判断一个数组,is array 、 instanceof constructor8. 谷歌浏览器F12在Source中如何
阅读全文
摘要:例子1——将类数组转换为数组 let array = { 0: 'name', 1: 'age', 2: 'sex', 3: ['user1','user2','user3'], 'length': 4 } let arr = Array.from(array ) console.log(arr)
阅读全文
摘要:http://www.360doc.com/content/19/0709/09/43615570_847586162.shtml
阅读全文
摘要:sticky 的本意是粘糊糊的,但在 css 中的表现更像是吸附。常见的吸顶、吸底(移动端网站的头部返回栏,底部切换栏之类)的效果用这个属性非常适合。 .sticky { position: sticky; position: -webkit-sticky; top: 0; } 特性(坑): 1.s
阅读全文
摘要:1.memo 用于优化方法 const Foo=memo((props)=>{ return <div>{props.person.age}</div> }) 2.useState const [count,setCount]=useState(()=>{ return PaymentRespons
阅读全文
摘要:代码拆分 Webpack-Code Splitting import import('./detail.js').then(...) import React, { Component,lazy,Suspense } from 'react'; const About = lazy(()=>impo
阅读全文
摘要:import React, { Component,createContext } from 'react'; const OnLineContext=createContext() //可以传入默认值 const BatteryContext=createContext(90) class Mid
阅读全文
摘要:1初始化项目 npm init create-react-app my-app 2.修改index import React from 'react'; import ReactDOM from 'react-dom'; import './index.css'; import App from '
阅读全文
摘要:1.微信支付 网页的微信支付返回的是一串链接,使用qrcode把链接生成二维码 让客户扫描 import QRCode from 'qrcode'QRCode.toDataURL(res.content) .then(url=>{ console.log(url,'生成的为base64的二维码图片'
阅读全文
摘要:方法一:插件 vue-infinite-scroll <template> <div> <div class="demo1" v-for="index of count" :key="index"> demo </div> <div v-infinite-scroll="loadMore" infi
阅读全文
摘要:1.子组件出发父组件事件 子组件触发:@click="$emit('cancel')" 父组件传入:@cancel="showModal=false" 2.父组件触发子组件事件 父组件:<child ref="mychild"></child> this.$refs.mychild.parentHa
阅读全文
摘要:子组件放置 <slot name="body"></slot> 父组件 <template v-slot:body> <p>商品添加成功!</p> </template>
阅读全文
摘要:1.设置代理 vue.config.vue module.exports={ devServer:{ host:'localhost', proxy:{ '/api':{ target:'http://mall-pre.springboot.cn', changeOrigin:true, pathR
阅读全文
摘要:npm install koa2-cors app.use(cors({ origin:['http://localhost:9528'], credentials:true //证书 }))
阅读全文
摘要:const rp=require('request-promise') const APPID='xxxxxxxxx' const AppSecret='xxxxxxxxxxxxxx' const URL=`https://api.weixin.qq.com/cgi-bin/token?grant_
阅读全文
摘要:新建文件夹 进入文件夹运行 npm init -y 新建app.js const Koa =require('koa') const app=new Koa() app.use(async(ctx)=>{ ctx.body='Hello world' }) app.listen(6789,()=>{
阅读全文
摘要:合理设置可点击元素的影响区域大小 避免渲染页面耗时过长 避免执行脚本耗时过长 对于网络请求做必要的缓存以避免多余的请求 不要引入未被使用的wxss样式 文字的颜色与背景色搭配 一般美工都给设计好了 所有资源请求建议使用https 不使用废弃接口 避免过大的WXML节点数目 一个页面少于1000个WX
阅读全文
摘要:const pages=getCurrentPages() //取到上一个页面 const prevPage=pages[pages.length-2] prevPage.onPullDownRefresh()
阅读全文
摘要:selector对象 this.selectComponent('.lyric').update(event.detail.currentTime)
阅读全文
摘要:组件:第一个参数传入出发方法的名字,第二个参数传入需要传入的参数 this.triggerEvent('timeUpdate',{ currentTime }) 页面:bind:xxx, xxx为传入的方法 也可以直接bindxxx <l-progress-bar bindtimeUpdate="t
阅读全文
摘要:1.网址 https://www.iconfont.cn/ 2.选择需要的图标加入购物车,然后加入项目 3.点击生成代码 4.复制链接,在游览器中进入链接,右键另存为 5. 将另存为的文件复制到根目录,把后缀改为wxss 6. 在app.wxss中引入iconfont文件 @import "./ic
阅读全文