Storybookv6中是否内置有一个组件,可帮助您记录模型?

问题描述

我的组件使用不同的模型类型来定义其道具。这是library(data.table) library(zoo) setDT(df1)[,.SD[seq_len(max(c(n,.N)))],school ][,rating := fifelse(is.na(rating),mean(rating,na.rm = TRUE),rating),school][,lapply(.SD,na.locf0)] 类型的示例:

df1 <- structure(list(player_id = c(473L,653L,816L,885L,906L,969L,998L,102L,106L,107L,23L,33L,44L,67L,74L,80L,87L,91L
),rating = c(0.8756,0.8646,0.8572,0.8547,0.8539,0.8519,0.8506,0.8498,0.8477,0.9867,0.9822,0.9764,0.9673,0.9654,0.9644,0.9614,0.9566),school = c("Cincinnati","Cincinnati","Clemson","Clemson"
)),class = "data.frame",row.names = c(NA,-18L))

某些组件使用此模型类型来描述其道具:

ColumnType

道具在组件故事中得到了很好的记录:

A storybook story,showing the prop types of a component

我尝试使用 docs插件中的export type ColumnType<T> = { key: keyof T; label: string; rules?: Rule[]; transformers?: Transformer[] }; (我已经在使用),但是我不知道如何使用。我已经在所有模型类型上面添加了JSDoc注释。是否有可能像Storybook一样使用组件props提取它们?

用Storybook(v6)描述这些模型类型的合适方法是什么?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)