diff --git a/src/.vuepress/config.js b/src/.vuepress/config.js index 216af11bcd..14090ad072 100644 --- a/src/.vuepress/config.js +++ b/src/.vuepress/config.js @@ -94,6 +94,7 @@ const sidebar = { children: [ 'migration/introduction', 'migration/async-components', + 'migration/attribute-coercion', 'migration/custom-directives', 'migration/custom-elements-interop', 'migration/data-option', diff --git a/src/guide/migration/attribute-coercion.md b/src/guide/migration/attribute-coercion.md new file mode 100644 index 0000000000..ab38246bf0 --- /dev/null +++ b/src/guide/migration/attribute-coercion.md @@ -0,0 +1,134 @@ +# Attribute Coercion Behavior + +::: info Info +This is a low-level internal API change and does not affect most developers. +::: + +## Overview + +Here is a high level summary of the changes: + +- Drop the internal concept of enumerated attributes and treat those attributes the same as normal non-boolean attributes +- **BREAKING**: No longer removes attribute if value is boolean false. Instead, it's set as attr="false" instead. To remove the attribute, use null or undefined. + +For more information, read on! + +## 2.x Syntax + +In 2.x, we had the following strategies for coercing `v-bind` values: + +- For some attribute/element pairs, Vue is always using the corresponding IDL attribute (property): [like `value` of ``, `