04 2020 档案

2019面试题1
摘要:1.原型和原型链2.继承3.闭包4.Promise的用法,promise.all的使用5. vue异步获取到数据,到渲染,这个过程的原理6. 把一个url转换成一个对象7. 如何判断一个数组,is array 、 instanceof constructor8. 谷歌浏览器F12在Source中如何 阅读全文

posted @ 2020-04-30 11:27 秃了头也不退休 阅读(121) 评论(0) 推荐(0)

js-Array.from()
摘要:例子1——将类数组转换为数组 let array = { 0: 'name', 1: 'age', 2: 'sex', 3: ['user1','user2','user3'], 'length': 4 } let arr = Array.from(array ) console.log(arr) 阅读全文

posted @ 2020-04-30 11:25 秃了头也不退休 阅读(4614) 评论(0) 推荐(0)

js的15种循环
摘要:http://www.360doc.com/content/19/0709/09/43615570_847586162.shtml 阅读全文

posted @ 2020-04-30 10:35 秃了头也不退休 阅读(147) 评论(0) 推荐(0)

css-postition:sticky
摘要:sticky 的本意是粘糊糊的,但在 css 中的表现更像是吸附。常见的吸顶、吸底(移动端网站的头部返回栏,底部切换栏之类)的效果用这个属性非常适合。 .sticky { position: sticky; position: -webkit-sticky; top: 0; } 特性(坑): 1.s 阅读全文

posted @ 2020-04-30 10:24 秃了头也不退休 阅读(959) 评论(0) 推荐(0)

react-hook
摘要:1.memo 用于优化方法 const Foo=memo((props)=>{ return <div>{props.person.age}</div> }) 2.useState const [count,setCount]=useState(()=>{ return PaymentRespons 阅读全文

posted @ 2020-04-28 14:44 秃了头也不退休 阅读(208) 评论(0) 推荐(0)

react lazy和suspense
摘要:代码拆分 Webpack-Code Splitting import import('./detail.js').then(...) import React, { Component,lazy,Suspense } from 'react'; const About = lazy(()=>impo 阅读全文

posted @ 2020-04-28 14:09 秃了头也不退休 阅读(233) 评论(0) 推荐(0)

react-context 和contextType
摘要:import React, { Component,createContext } from 'react'; const OnLineContext=createContext() //可以传入默认值 const BatteryContext=createContext(90) class Mid 阅读全文

posted @ 2020-04-28 11:34 秃了头也不退休 阅读(401) 评论(0) 推荐(0)

React-多页面应用
摘要: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 ' 阅读全文

posted @ 2020-04-26 18:05 秃了头也不退休 阅读(3240) 评论(0) 推荐(0)

vue-网页支付 --支付宝和微信支付
摘要:1.微信支付 网页的微信支付返回的是一串链接,使用qrcode把链接生成二维码 让客户扫描 import QRCode from 'qrcode'QRCode.toDataURL(res.content) .then(url=>{ console.log(url,'生成的为base64的二维码图片' 阅读全文

posted @ 2020-04-24 17:40 秃了头也不退休 阅读(2565) 评论(0) 推荐(0)

vue-触底加载更多
摘要:方法一:插件 vue-infinite-scroll <template> <div> <div class="demo1" v-for="index of count" :key="index"> demo </div> <div v-infinite-scroll="loadMore" infi 阅读全文

posted @ 2020-04-24 17:10 秃了头也不退休 阅读(2945) 评论(1) 推荐(0)

vue-组件之间互相出发事件
摘要:1.子组件出发父组件事件 子组件触发:@click="$emit('cancel')" 父组件传入:@cancel="showModal=false" 2.父组件触发子组件事件 父组件:<child ref="mychild"></child> this.$refs.mychild.parentHa 阅读全文

posted @ 2020-04-23 10:04 秃了头也不退休 阅读(1548) 评论(0) 推荐(0)

vue-插槽 slot
摘要:子组件放置 <slot name="body"></slot> 父组件 <template v-slot:body> <p>商品添加成功!</p> </template> 阅读全文

posted @ 2020-04-22 17:16 秃了头也不退休 阅读(198) 评论(0) 推荐(0)

vue-知识点
摘要:1.设置代理 vue.config.vue module.exports={ devServer:{ host:'localhost', proxy:{ '/api':{ target:'http://mall-pre.springboot.cn', changeOrigin:true, pathR 阅读全文

posted @ 2020-04-17 11:01 秃了头也不退休 阅读(157) 评论(0) 推荐(0)

koa-解决跨域问题
摘要:npm install koa2-cors app.use(cors({ origin:['http://localhost:9528'], credentials:true //证书 })) 阅读全文

posted @ 2020-04-16 09:13 秃了头也不退休 阅读(561) 评论(0) 推荐(0)

微信小程序-koa-获取微信access-token
摘要:const rp=require('request-promise') const APPID='xxxxxxxxx' const AppSecret='xxxxxxxxxxxxxx' const URL=`https://api.weixin.qq.com/cgi-bin/token?grant_ 阅读全文

posted @ 2020-04-15 17:22 秃了头也不退休 阅读(479) 评论(0) 推荐(0)

koa-创建项目
摘要:新建文件夹 进入文件夹运行 npm init -y 新建app.js const Koa =require('koa') const app=new Koa() app.use(async(ctx)=>{ ctx.body='Hello world' }) app.listen(6789,()=>{ 阅读全文

posted @ 2020-04-15 17:10 秃了头也不退休 阅读(145) 评论(0) 推荐(0)

微信小程序-性能与体验优化
摘要:合理设置可点击元素的影响区域大小 避免渲染页面耗时过长 避免执行脚本耗时过长 对于网络请求做必要的缓存以避免多余的请求 不要引入未被使用的wxss样式 文字的颜色与背景色搭配 一般美工都给设计好了 所有资源请求建议使用https 不使用废弃接口 避免过大的WXML节点数目 一个页面少于1000个WX 阅读全文

posted @ 2020-04-15 10:45 秃了头也不退休 阅读(331) 评论(0) 推荐(0)

微信小程序-调取上一页的方法
摘要:const pages=getCurrentPages() //取到上一个页面 const prevPage=pages[pages.length-2] prevPage.onPullDownRefresh() 阅读全文

posted @ 2020-04-13 11:34 秃了头也不退休 阅读(629) 评论(0) 推荐(0)

微信小程序-页面触发组件中的方法
摘要:selector对象 this.selectComponent('.lyric').update(event.detail.currentTime) 阅读全文

posted @ 2020-04-10 11:46 秃了头也不退休 阅读(991) 评论(0) 推荐(0)

微信小程序-从组件触发页面任务
摘要:组件:第一个参数传入出发方法的名字,第二个参数传入需要传入的参数 this.triggerEvent('timeUpdate',{ currentTime }) 页面:bind:xxx, xxx为传入的方法 也可以直接bindxxx <l-progress-bar bindtimeUpdate="t 阅读全文

posted @ 2020-04-10 11:41 秃了头也不退休 阅读(521) 评论(0) 推荐(0)

微信小程序-引入iconfont图标
摘要:1.网址 https://www.iconfont.cn/ 2.选择需要的图标加入购物车,然后加入项目 3.点击生成代码 4.复制链接,在游览器中进入链接,右键另存为 5. 将另存为的文件复制到根目录,把后缀改为wxss 6. 在app.wxss中引入iconfont文件 @import "./ic 阅读全文

posted @ 2020-04-10 11:35 秃了头也不退休 阅读(571) 评论(0) 推荐(0)

导航