From 78789c6d21c0280698bf3fcacabf38e6a4323f7c Mon Sep 17 00:00:00 2001 From: neverland Date: Thu, 30 Nov 2017 19:05:54 +0800 Subject: [PATCH] [Doc] add props name style guide (#366) --- docs/markdown/en-US/quickstart.md | 12 ++++++++++++ docs/markdown/zh-CN/quickstart.md | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/docs/markdown/en-US/quickstart.md b/docs/markdown/en-US/quickstart.md index 3027e4e2c..4bc267787 100644 --- a/docs/markdown/en-US/quickstart.md +++ b/docs/markdown/en-US/quickstart.md @@ -58,3 +58,15 @@ Vue.use(Vant); ``` + +### Props Named Style +HTML attributes are case-insensitive, so when using non-string templates, camelCased prop names need to use their kebab-case (hyphen-delimited) equivalents. + +``` html + + + + + +``` + diff --git a/docs/markdown/zh-CN/quickstart.md b/docs/markdown/zh-CN/quickstart.md index e68284bbb..6499f5fdb 100644 --- a/docs/markdown/zh-CN/quickstart.md +++ b/docs/markdown/zh-CN/quickstart.md @@ -65,3 +65,15 @@ Vue.use(Vant); ```shell vue init youzan/vue-cli-template-vant projectName ``` + +### Props 命名风格 +Vant 文档中的 props 默认采用驼峰式命名 (camelCase)。由于 HTML 特性是不区分大小写的,如果在 HTML 中直接书写 Vue 模板,需要使用短横线分割式 (kebab-case) 的命名来传递 props + +``` html + + + + + +``` +