Skip to content

[Discussion] PWC props 命名问题 #64

@ChrisCindy

Description

@ChrisCindy

HTML 标准中对 attribute 是大小写不敏感的。pwc 依赖的解析库也严格遵守规范实现,导致如果用户使用驼峰式命名传递 props:

<template>
  <child-component customProp="123"></child-component>
</template>

customProp 会被解析为 customprop,不符合预期。

解法讨论:

  1. 约束用户配置 props 时采用纯小写(customprop)或连字符(custom-prop)形式
  2. 换 XML 解析库
  3. fork parse5 自行支持大小写敏感能力

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions