代码之家  ›  专栏  ›  技术社区  ›  StackedQ the red crafteryt

Github和npm表降价之间的差异

  •  0
  • StackedQ the red crafteryt  · 技术社区  · 6 年前

    我的 readme.md 降价表在npm上显示正确,但在GitHub上显示不正确。

    这是表格降价:

       Attributes  | Field type | value |  description
    - | - | - | -
    required | `*`  | boolean`(default=false)` | check if field has a value if set true.
      requiredPhrase | `*`  | string`(default=This field is required.)` | error shown when field is required and empty.
    name  | `*`  | string | a unique string in form, on submitting the form you can access a field value by values.`<name>`
    placeholder  | `*`  | string`(default=null)` | inputs placeholder.
    defaultValue | `*`  | any`(default=null)` | in case of editing forms pass current values via `defaultValue`.
     maxLength | `text`, `number` and `password` | number`(default=null)` | maximum value length.
      maxLengthErrorPhrase | `text`, `number` and `password` | string`(default=This field accepts <maxLength> characters.)` | error shown when maxLength is crossed.
       multiSelect | `select`| boolean`(default=false)` | set true if select can have more than one values.
       selectHandle | `select` | component`(default=an ungly css-made triangle)`, example: `<i className="ion-ios-arrow-down` (which needs ionicons) | this option is for changing the select box handle component.   
       options | `select`, `radio` | array of objects with `label` and `value` | choices for select input and radio group.
       checkboxLabel| `checkbox` | string`(default:'')`| checkbox label.
       mustBeCheckedPhrase| `checkbox` | string`(default:'This field must be checked.')`| error shown when checkbox is required and not checked.
    

    也许GitHub使用了不同的降价?

    1 回复  |  直到 2 年前
        1
  •  1
  •   Chris    6 年前

    添加主管:

    | Attributes  | Field type | value |  description
    | - | - | - | -
    | required | `*` | boolean`(default=false)` | check if field has a value if set true.
    | requiredPhrase | `*` | string`(default=This field is required.)` | error shown when field is required and empty.
    

    或者使用两个(或更多)连字符而不是一个,这样它们就不会被解析为项目符号:

    Attributes  | Field type | value |  description
    -- | -- | -- | --
    required | `*` | boolean`(default=false)` | check if field has a value if set true.
    requiredPhrase | `*` | string`(default=This field is required.)` | error shown when field is required and empty.
    

    我还建议去掉参差不齐的前导空格,以提高原始降价的可读性。