#1029·ink

`minWidth` 和 `maxWidth` 接受文档中表示为不受支持的百分比

作者: costajohnt创建于 2026年9月20日更新于 2026年9月20日

`minWidth` 和 `maxWidth` 在 `Styles` (src/styles.ts) 中被类型为 `number | string`,而 `styles.ts` 将字符串映射为 `setMinWidthPercent` / `setMaxWidthPercent`。`readme` 和文档注释中都提到 `Type: number` 以及 "百分比尚未受支持;请参阅 https://GitHub.com/facebook/yoga/issues/872"。因此,TypeScript 会接受文档中表示不支持的值,并且该值会默默地根据错误的祖先进行解析。

内容来源: vadimdemedes/ink