看插件源码偶然发现这种写法:type Axis = 'both' | 'x' | 'y' | 'none';import type {Element as ReactElement, Node as ReactNode} from 'react';请问里面的type是什么意思?import React from 'react';import PropTypes from 'prop-types';import {DraggableCore} from 'react-draggable';import cloneElement from './cloneElement';import type {Element as ReactElement, Node as ReactNode} from 'react';type Axis = 'both' | 'x' | 'y' | 'none';type State = {
resizing: boolean,
width: number, height: number,
slackW: number, slackH: number};type DragCallbackData = {
node: HTMLElement,
x: number, y: number,
deltaX: number, deltaY: number,
lastX: number, lastY: number};export type ResizeCallbackData = {
node: HTMLElement,
size: {width: number, height: number}
};//...
添加回答
举报
0/150
提交
取消