Add an Error pattern to help with required component props

未关闭
#1,690 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

已经有一个关联 PR 被合并了。

  • #1937 来自 @AriannaChau —— 已合并

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
领域
design, frontend

调研方向

审查提议的 Twig defined 测试和现有的组件模式,以确定如何识别必需的 props。完成的标准是存在一个明显且高度可见的 Error 模式,并且在缺少必需 props 时,受影响的模式会 render 它;issue 未指明文件或测试,因此需要调查实现范围。

由索引模型根据 Issue 内容生成。

描述

:construction_worker: dev

This is an idea @calebeby came up with as a way to help make sure required component props are not accidentally missed when using a given component.

Maybe you could do something with defined? Maybe render a message instead of the component if a given prop is not defined? 🤔

Oh yeah that might be helpful. IDK if it's worth it, but we could probably make a error pattern that is very visible/flashy and then go through all our patterns and make them render the error pattern if any of their required props are missing

It may not be a higher priority, but would be helpful throughout the implementation of the components.

主要语言
SCSS
星标
26
派生
4
平均合并
16 小时 7 分钟
30 天内合并 PR
88

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

cloudfour/cloudfour.com-patterns 的其他 Issue

查看 cloudfour/cloudfour.com-patterns 的全部 Issue

相似的 Issue

更多 Design Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。