Skip to content

react-vant 源码探索 #83

Answered by TinsFox
TinsFox asked this question in Q&A
Discussion options

You must be logged in to vote

在创建组件的属性的时候,会使用typeinterface 进行声明,这是为什么呢,一般来说

export type ActionSheetAction = {
  /** 标题	 */
  name?: string;
  /** 选项文字颜色	 */
  color?: string;
  /** 二级标题	 */
  subname?: string;
  style?: React.CSSProperties;
};

export interface ActionSheetProps extends BaseTypeProps, SharedPopupProps {
  visible?: boolean;
  /** 面板选项列表	 */
  actions?: ActionSheetAction[];
  /** 顶部标题	 */
  title?: React.ReactNode;
  /** 取消按钮文字	 */
  cancelText?: React.ReactNode;
  /** 选项上方的描述信息	 */
  /** 点击取消按钮时触发	 */
  onCancel?: () => void;
}

Replies: 1 comment

Comment options

TinsFox
Sep 17, 2021
Collaborator Author

You must be logged in to vote
0 replies
Answer selected by 3lang3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
🧑‍💻 docs Improvements or additions to documentation 🍻 discuss some feat need short discuss in issue
1 participant