Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Discussion] PWC props 命名问题 #64

Open
ChrisCindy opened this issue Apr 25, 2022 · 0 comments
Open

[Discussion] PWC props 命名问题 #64

ChrisCindy opened this issue Apr 25, 2022 · 0 comments

Comments

@ChrisCindy
Copy link
Contributor

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

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

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

解法讨论:

  1. 约束用户配置 props 时采用纯小写(customprop)或连字符(custom-prop)形式
  2. 换 XML 解析库
  3. fork parse5 自行支持大小写敏感能力
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant