From 50589c52d89e06a4ee14c950d550c6f235125940 Mon Sep 17 00:00:00 2001 From: Evan You Date: Thu, 21 Feb 2019 10:49:53 -0500 Subject: [PATCH 01/11] add a note about dynamic arguments in in-DOM templates --- src/v2/guide/syntax.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/v2/guide/syntax.md b/src/v2/guide/syntax.md index a0693af2c2..afb7843152 100644 --- a/src/v2/guide/syntax.md +++ b/src/v2/guide/syntax.md @@ -154,7 +154,7 @@ Dynamic arguments are expected to evaluate to a string, with the exception of `n #### Dynamic Argument Expression Constraints -

Dynamic argument expressions have some syntax constraints because certain characters are invalid inside HTML attribute names, such as spaces and quotes.

+

Dynamic argument expressions have some syntax constraints because certain characters are invalid inside HTML attribute names, such as spaces and quotes. You also need to avoid uppercase keys when using in-DOM templates.

For example, the following is invalid: @@ -165,6 +165,13 @@ For example, the following is invalid: The workaround is to either use expressions without spaces or quotes, or replace the complex expression with a computed property. +In addition, if you are using in-DOM templates (templates directly written in an HTML file), you have to be aware that browsers will coerce attribute names into lowercase: + +``` html + + ... +``` + ### Modifiers Modifiers are special postfixes denoted by a dot, which indicate that a directive should be bound in some special way. For example, the `.prevent` modifier tells the `v-on` directive to call `event.preventDefault()` on the triggered event: From ce208ae4acbbfafe5f2c5904d1fd378b4c883882 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Fri, 22 Feb 2019 12:16:35 +0100 Subject: [PATCH 02/11] Add Function type to props (#2026) * Add Function type to props * add Promise contstructor prop type --- src/v2/guide/components-props.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/v2/guide/components-props.md b/src/v2/guide/components-props.md index d89f2632f1..d4ccbc1b67 100644 --- a/src/v2/guide/components-props.md +++ b/src/v2/guide/components-props.md @@ -41,7 +41,9 @@ props: { likes: Number, isPublished: Boolean, commentIds: Array, - author: Object + author: Object, + callback: Function, + contactsPromise: Promise // or any other constructor } ``` From 5a96862fffd3142cdb7656b4614874826159198b Mon Sep 17 00:00:00 2001 From: Natalia Tepluhina Date: Fri, 22 Feb 2019 13:28:34 +0200 Subject: [PATCH 03/11] Update core focus for myself (#2025) * Add docs repo as core focus - and apparently fixed James McGlasson photo xD --- src/v2/guide/team.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/v2/guide/team.md b/src/v2/guide/team.md index 1af3b94456..f5756e41f2 100644 --- a/src/v2/guide/team.md +++ b/src/v2/guide/team.md @@ -764,7 +764,7 @@ order: 803 { name: 'James McGlasson', title: 'Head of Marketing Communications', - imageUrl: 'https://media.licdn.com/dms/image/C4E03AQHxi_fy33l5Mg/profile-displayphoto-shrink_800_800/0?e=1550707200&v=beta&t=6kPVnuYMxbxR_oAz3rdAeuDB-S8Om8e5W3zwbcH0dQI', + imageUrl: 'https://media.licdn.com/dms/image/C4E03AQHxi_fy33l5Mg/profile-displayphoto-shrink_800_800/0?e=1556150400&v=beta&t=KADJ_7nuWuYFPQaKtK7QuI96iC0gPKc198GZ-_dXr_0', city: 'Amsterdam, Netherlands', languages: ['en', 'nl', 'de'], work: { @@ -797,9 +797,13 @@ order: 803 title: 'Fox Tech Guru', city: 'Kyiv, Ukraine', languages: ['uk', 'ru', 'en'], + reposOfficial: [ + 'vuejs.org' + ], work: { - role: 'CTO', - org: 'Vue Vixens', + role: 'Senior Frontend Engineer', + org: 'GitLab', + orgUrl: 'https://gitlab.com/' }, github: 'NataliaTepluhina', twitter: 'N_Tepluhina', From 3119f1d42230fa9d85507eafcf4533c24174bcb4 Mon Sep 17 00:00:00 2001 From: Natalia Tepluhina Date: Sun, 24 Feb 2019 13:54:58 +0200 Subject: [PATCH 04/11] Added options for object-based props definition in API (#2028) * feat: add API entry on props options - fixed a link to props section * fix: moved a link and added read-more types link * Update src/v2/api/index.md Co-Authored-By: NataliaTepluhina * Update src/v2/api/index.md Co-Authored-By: NataliaTepluhina * Update src/v2/api/index.md Co-Authored-By: NataliaTepluhina --- src/v2/api/index.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/v2/api/index.md b/src/v2/api/index.md index c9231f7c66..bf5b600a1b 100644 --- a/src/v2/api/index.md +++ b/src/v2/api/index.md @@ -509,6 +509,15 @@ type: api A list/hash of attributes that are exposed to accept data from the parent component. It has an Array-based simple syntax and an alternative Object-based syntax that allows advanced configurations such as type checking, custom validation and default values. + With Object-based syntax, you can use following options: + - **type:** can be one of the following native constructors: `String`, `Number`, `Boolean`, `Array`, `Object`, `Date`, `Function`, `Symbol`, any custom constructor function or an array of those. Will check if a prop has a given type, and will throw a warning if it doesn't. [More information](../guide/components-props.html#Prop-Types) on prop types. + - **default:** `any` + Specifies a default value for the prop. If the prop is not passed, this value will be used instead. Object or array defaults must be returned from a factory function. + - **required:** `Boolean` + Defines if the prop is required. In a non-production environment, a console warning will be thrown if this value is truthy and the prop is not passed. + - **validator:** `Function` + Custom validator function that takes the prop value as the sole argument. In a non-production environment, a console warning will be thrown if this function returns a falsy value (i.e. the validation fails). You can read more about prop validation [here](../guide/components-props.html#Prop-Validation). + - **Example:** ``` js @@ -535,7 +544,7 @@ type: api }) ``` -- **See also:** [Props](../guide/components.html#Props) +- **See also:** [Props](../guide/components-props.html) ### propsData From fc6b2927b1c41a85ed921d4d882874afb7284e3c Mon Sep 17 00:00:00 2001 From: zdsfwy <123504381@qq.com> Date: Mon, 25 Feb 2019 10:27:40 +0800 Subject: [PATCH 05/11] to reduce misleading, add a note for [v-for with v-if] section (#2029) * to reduce misleading, add a note for [v-for with v-if] section * move note to the top of the target section --- src/v2/guide/list.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/v2/guide/list.md b/src/v2/guide/list.md index 38c76209d7..153a19bc86 100644 --- a/src/v2/guide/list.md +++ b/src/v2/guide/list.md @@ -441,6 +441,8 @@ Similar to template `v-if`, you can also use a `