自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(10)
  • 收藏
  • 关注

原创 JS数据转换,树形结构和平铺结构的转换

在实际的业务或者说面试,会有将树形转为平铺,或者是平铺转换为树形的需求,下面我们来写一下两者转化的区别.首先给大家介绍一下数据结构展现的方式这是树形结构数据: const arr= [{ id: 1, name: 'A', children: [{ id: 11, name: 'A1', children: [{

2022-04-24 19:13:14 3769 2

原创 简易小盒子拖拽 typeScript版

tsx代码interface Isprops {}interface State { x: number, y: number}export default class index extends Component<Isprops, State> { x: number = 0 y: number = 0 disX: number = 0 disY: number = 0 boxRef=createRef<HTMLDivElement>

2022-04-24 18:57:48 1245

原创 面试题 扑克牌解法

从扑克牌中随机抽5张牌,判断是不是一个顺子, 即这5张牌是不是连续的2~10为数字本身, A为1。 J为11、Q为12、 为13。小王可以看成任意数字function getPoker() { var arr = ['A', 2, 3, 4, 5, 6, 7, 8, 9, 'J', 'Q', 'K'] arr = [...arr, ...arr, ...arr, ...arr, '大王', '小王'] var newArr ...

2022-04-20 07:32:23 478

原创 vue3.0+TS的选项卡

vue3.0+ts版本的选项卡

2022-04-19 15:19:33 1200

原创 什么是跨域?为什么要跨域?以及json跨域

什么是跨域?为什么要跨域?以及json跨域

2022-04-12 15:15:00 276

原创 文件框拖拽 拉伸

代码奉上tsx代码:import React, { Component, RefObject } from 'react'import './index.css'interface Iprop { }interface Istate { arr: arr[]}interface arr { id: symbol, txt: string}export default class index extends Component<Iprop, Ist

2022-03-27 20:13:43 743

原创 极简风,双球拖拽 (交叉版)

tsx代码import React, { Component } from 'react'import './index.css'interface Iprop { }interface Istate { }export default class index extends Component<Iprop, Istate> { constructor(props: Iprop) { super(props) this.state = {}

2022-03-25 10:57:22 157

原创 react+ts小球抛物线

代码奉上css:html,body{ height: 100%;}#root,.App,.wrap{ height: 100%; width: 100%;}.ball{ width: 60px; height: 60px; border-radius: 50%; position: absolute; background-color: tomato; transition: left 1s linear, top

2022-03-22 10:30:33 1056

原创 react+ts 双球滑动,碰撞

直接上代码tsx部分:import React, { Component, createRef } from 'react';import './index.less'interface Props { }interface State { }class Ball extends Component<Props, State> { // ref获取线div line = createRef<HTMLDivElement>() // wrap

2022-03-21 16:04:49 240

原创 react+ts 双球拖动滑块效果,碰撞

直接上代码tsx部分:import React, { Component, createRef } from 'react';import './index.less'interface Props { }interface State { }class Ball extends Component<Props, State> { // ref获取线div line = createRef<HTMLDivElement>() // wrap

2022-03-21 15:58:43 1390

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除