From 449782415ab304dc5b79f7e2e6c12256c86c2c36 Mon Sep 17 00:00:00 2001 From: sondh0127 <62163604+sondh0127@users.noreply.github.com> Date: Sun, 8 May 2022 16:14:02 +0700 Subject: [PATCH] Correct default value for absent props. (#1705) The Boolean missing prop will cast to false instead of undefined, https://github.com/vuejs/core/issues/5863#issuecomment-1118446966 --- src/guide/components/props.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/guide/components/props.md b/src/guide/components/props.md index d11fcc1314..65167287f1 100644 --- a/src/guide/components/props.md +++ b/src/guide/components/props.md @@ -482,7 +482,9 @@ Additional details: - All props are optional by default, unless `required: true` is specified. -- An absent optional prop will have `undefined` value. +- An absent optional prop other than `Boolean` will have `undefined` value. + +- The `Boolean` absent props will be cast to `false`. You should set a `default` value for it in order to get desired behavior. - If a `default` value is specified, it will be used if the resolved prop value is `undefined` - this includes both when the prop is absent, or an explicit `undefined` value is passed.