_^_^_nicole

2022年10月26日

手写Promise 实现 then catch方法(新添加resolve,reject,all)

摘要: class MyPromise { constructor(callback) { if (typeof callback !== 'function') throw new TypeError(`MyPromise resolver ${callback} is not a function`); 阅读全文

posted @ 2022-10-26 16:19 _^_^_nicole 阅读(32) 评论(0) 推荐(0) 编辑

2022年10月11日

axios二次封装

摘要: import axios from 'axios'; import nprogress from 'nprogress'; import { message as MSG } from 'antd'; const baseURL = ''; const service = axios.create( 阅读全文

posted @ 2022-10-11 21:14 _^_^_nicole 阅读(11) 评论(0) 推荐(0) 编辑

2022年8月3日

vue2中的底部弹出层Popup(类似购物车)

摘要: <template> <view v-show="isShow" class="mask" :style="{bottom:bottom}" @click="setShow"> <scroll-view @click.stop scroll-y="true" class="container" :a 阅读全文

posted @ 2022-08-03 17:28 _^_^_nicole 阅读(592) 评论(0) 推荐(0) 编辑

2022年6月30日

taro微信小程序中的canvas圆环

摘要: useEffect(() => { Taro.createSelectorQuery() .select("#canvas") .fields({ node: true, size: true }) .exec(res => { if (res[0] && res[0].width) { if(st 阅读全文

posted @ 2022-06-30 17:09 _^_^_nicole 阅读(459) 评论(0) 推荐(0) 编辑
taro微信小程序中的简单动画(模态框弹出)

摘要: // 充电桩项目中模态框 import { useRef, useEffect, useState, useMemo } from "react"; import "./index.less"; import Taro from "@tarojs/taro"; function Modal(prop 阅读全文

posted @ 2022-06-30 17:01 _^_^_nicole 阅读(454) 评论(0) 推荐(0) 编辑

2022年1月14日

对象键名适配器

摘要: 适配器: // 对象key适配器封装 function updateObjectKey(objArr, arg) { // 传的arg参数是数组时 if (Array.isArray(arg)) { return updateObjectKeyOfArray(objArr, arg); } // 传 阅读全文

posted @ 2022-01-14 17:04 _^_^_nicole 阅读(37) 评论(0) 推荐(1) 编辑

2022年1月5日

vue中组件间通信方式的总结

摘要: 面试中,经常会问到vue中组件间的通信方式有哪些? 今天我们就来总结下。 vue中组件间的通信方式 方法一、props/$emit 这是我们比较熟悉的方式,主要是父子组件之间的传递方式,父传子使用props,子传父使用$emit. 此方法经常使用,就不罗列代码了 方法二、$emit/$on 这种方法 阅读全文

posted @ 2022-01-05 17:07 _^_^_nicole 阅读(47) 评论(0) 推荐(1) 编辑
js有关面试的问题及详解

摘要: 目录 闭包 类的继承与创建 如何解决回调地狱 事件委托 说一下图片的懒加载和预加载 mouseover和mouseenter的区别 js的new操作符做了哪些事情 改变函数内部this指针的指向函数(bind,apply,call的区别) js的各种位置,比如clientHeight,scrollH 阅读全文

posted @ 2022-01-05 16:44 _^_^_nicole 阅读(63) 评论(0) 推荐(1) 编辑