React+ts仿小球模块左右滑动交叉碰撞
index.tsx
import { Component } from "react";
import './xiaoqou.less';
interface Props {
}
interface State {
Num: number,
MaxNum: number,
}
class Drag extends Component
constructor(props: Props) {
super(props);
this.state = {
Num: 0,
MaxNum: 100
}
}
parent?: HTMLDivElement;
child!: HTMLCollection;
startX: number = 0;
ballW: number = 0;
oW: number = 0;
x: number = 0;
dis: number = 0;
Num: number = 0;
Max
共有 0 条评论