摘要: 1.获取内联样式:element.style.width/height;--‘100px’ 2.获取实时样式:window.getComputerStyle(ele).width/height; --'100px' 3.IE9以下获取实时样式:element.currentStyle.width/h 阅读全文
posted @ 2022-04-22 15:59 桃李子 阅读(88) 评论(0) 推荐(0) 编辑
摘要: 1.Warning: [antd: Form.Item] `children` is array of render props cannot have `name`: Form.Item里面只能包裹一个“子”,多个“子”外面需要多嵌套一层Form.Item。 <FormItem> <FormIte 阅读全文
posted @ 2021-12-06 16:09 桃李子 阅读(666) 评论(2) 推荐(0) 编辑
摘要: text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; overflow: hidden; /*! autoprefixer: off */ -webkit-box-orient: vertical; /*! aut 阅读全文
posted @ 2021-09-30 17:15 桃李子 阅读(650) 评论(0) 推荐(0) 编辑
摘要: 1、chartAt:string.charAt(index),返回指定位置的字符; 2、chartCodeAt:string.charCodeAt(index),返回指定位置的字符的 Unicode 编码( 0 - 65535); 3、fromCharCode:String.fromCharCode 阅读全文
posted @ 2021-09-30 17:04 桃李子 阅读(185) 评论(0) 推荐(0) 编辑
摘要: 一、查找类 1、find:array.find(function(currentValue, index, arr),thisValue),第二个参数基本不使用,返回查找到的元素,查找不到返回undefined,不改变原数组; 2、findIndex:array.findIndex(function 阅读全文
posted @ 2021-09-30 11:37 桃李子 阅读(156) 评论(0) 推荐(0) 编辑
摘要: 题目来源于这位大佬的博客:『前端积累』算法汇总【持续更新】 - 风雨后见彩虹 - 博客园 (cnblogs.com) // 求数组内两数和,跟题目要求不太一样 var nums = [1,2,2,4,3,6,8,5]; var target = 6; var result = []; nums.fo 阅读全文
posted @ 2021-09-28 17:19 桃李子 阅读(92) 评论(0) 推荐(0) 编辑
摘要: const data = [{ id: 1, name: '一' },{ id: 2, name: '二' },{ id: 2, name: '三' }] interface Data { id: number; name: string; } const result = data.reduce( 阅读全文
posted @ 2021-09-08 14:31 桃李子 阅读(1010) 评论(0) 推荐(0) 编辑
摘要: 父组件 import React from 'react'; import Son from './Son'; const Farther = (props) => { const [form] = Form.useForm(); const { Item } = Form; return ( <d 阅读全文
posted @ 2021-09-03 15:46 桃李子 阅读(2648) 评论(0) 推荐(0) 编辑
摘要: 原始类型: undefined、string、number、boolean、symbol 引用类型:object、array、null、function 这两种类型最大的区别就是,原始类型的变量,复制后是独立的两个变量,改变其中一个另外一个变量不会被改变;反之,引用类型的变量复制之后,修改其中一个变 阅读全文
posted @ 2021-09-02 16:55 桃李子 阅读(271) 评论(0) 推荐(0) 编辑
摘要: 先看一个例子 // 去重 const numArr2 = [1, 2, 2, 3, 4, 5, 6, 6]; // 这里是普通数组去重,对象数组去重跟这个例子方法不同 const newNumArr2 = numArr2.reduce((item, next) => { item.indexOf(n 阅读全文
posted @ 2021-09-02 16:42 桃李子 阅读(37) 评论(0) 推荐(0) 编辑