From c700c6746fd6c5af2142ae80640d2d7ae331029c Mon Sep 17 00:00:00 2001 From: Ben Hong Date: Tue, 14 Jul 2020 23:31:19 -0400 Subject: [PATCH 1/9] docs (#149): add attribute coercion section to migration guide --- src/.vuepress/config.js | 3 +- src/guide/migration/attribute-coercion.md | 134 ++++++++++++++++++++++ 2 files changed, 136 insertions(+), 1 deletion(-) create mode 100644 src/guide/migration/attribute-coercion.md diff --git a/src/.vuepress/config.js b/src/.vuepress/config.js index 2a31451bcd..7a243ff052 100644 --- a/src/.vuepress/config.js +++ b/src/.vuepress/config.js @@ -100,7 +100,8 @@ const sidebar = { 'migration/fragments', 'migration/render-function-api', 'migration/slots-unification', - 'migration/keycode-modifiers' + 'migration/keycode-modifiers', + 'migration/attribute-coercion' ] }, { diff --git a/src/guide/migration/attribute-coercion.md b/src/guide/migration/attribute-coercion.md new file mode 100644 index 0000000000..82b1f522ad --- /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 ``, ``, `