From 2de6af8a27f43686789f178ddc93478de21d2d06 Mon Sep 17 00:00:00 2001 From: Rasmus Nielsen Date: Mon, 12 Oct 2020 11:31:56 +0200 Subject: [PATCH 1/4] specify support of sidebar + array --- src/components/navbar/README.md | 7 ++++--- src/components/navbar/navbar-toggle.js | 2 +- src/components/navbar/package.json | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/components/navbar/README.md b/src/components/navbar/README.md index a99b2d080d1..7b3973cd687 100644 --- a/src/components/navbar/README.md +++ b/src/components/navbar/README.md @@ -292,8 +292,10 @@ Internally, `` uses the [`v-b-toggle` directive](/docs/directiv `` renders the default Bootstrap v4 _hamburger_ (which is a background SVG image). You can supply your own content (such as an icon) via the optionally scoped `default` slot. The default slot scope contains the property `expanded`, which will be `true` when the collapse is -expanded, or `false` when the collapse is collapsed. You can use this to swap the toggle content -based on the collapse state: +expanded, or `false` when the collapse is collapsed. The `expanded` scope property only works when +supplying the `target` prop with a `string`, and not an `array`. + +You can use this to swap the toggle content based on the collapse state: ```html - ``` diff --git a/src/components/navbar/navbar-toggle.js b/src/components/navbar/navbar-toggle.js index d6eb79036fc..87d3d114b69 100644 --- a/src/components/navbar/navbar-toggle.js +++ b/src/components/navbar/navbar-toggle.js @@ -22,7 +22,7 @@ export const BNavbarToggle = /*#__PURE__*/ Vue.extend({ default: () => getComponentConfig(NAME_NAVBAR_TOGGLE, 'label') }, target: { - type: String, + type: [String, Array], required: true }, disabled: { diff --git a/src/components/navbar/package.json b/src/components/navbar/package.json index 9f941793b46..8542f087578 100644 --- a/src/components/navbar/package.json +++ b/src/components/navbar/package.json @@ -71,7 +71,7 @@ "props": [ { "prop": "target", - "description": "ID of the collapse the toggle controls" + "description": "id (or array of ids) of the collapse/sidebar components that should be toggled" }, { "prop": "label", From 37696477b761994859c2c9193eedd0cdc9d60f78 Mon Sep 17 00:00:00 2001 From: Rasmus Nielsen Date: Mon, 12 Oct 2020 11:38:52 +0200 Subject: [PATCH 2/4] update package.json --- src/components/navbar/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/navbar/package.json b/src/components/navbar/package.json index 8542f087578..0ff8149a866 100644 --- a/src/components/navbar/package.json +++ b/src/components/navbar/package.json @@ -71,7 +71,7 @@ "props": [ { "prop": "target", - "description": "id (or array of ids) of the collapse/sidebar components that should be toggled" + "description": "ID (or array of IDs) of the collapse/sidebar components that should be toggled" }, { "prop": "label", From fbf0827610c91a41efd609c2814989eb897a9d24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20M=C3=BCller?= Date: Mon, 12 Oct 2020 14:24:08 +0200 Subject: [PATCH 3/4] Update navbar-toggle.js --- src/components/navbar/navbar-toggle.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/navbar/navbar-toggle.js b/src/components/navbar/navbar-toggle.js index 87d3d114b69..721d04dbb86 100644 --- a/src/components/navbar/navbar-toggle.js +++ b/src/components/navbar/navbar-toggle.js @@ -22,7 +22,7 @@ export const BNavbarToggle = /*#__PURE__*/ Vue.extend({ default: () => getComponentConfig(NAME_NAVBAR_TOGGLE, 'label') }, target: { - type: [String, Array], + type: [Array, String], required: true }, disabled: { From a5241ea3bd9b67e2b63ddcf335d231c10e670ad2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20M=C3=BCller?= Date: Mon, 12 Oct 2020 14:24:12 +0200 Subject: [PATCH 4/4] Update README.md --- src/components/navbar/README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/navbar/README.md b/src/components/navbar/README.md index 7b3973cd687..f2ad224c087 100644 --- a/src/components/navbar/README.md +++ b/src/components/navbar/README.md @@ -292,10 +292,10 @@ Internally, `` uses the [`v-b-toggle` directive](/docs/directiv `` renders the default Bootstrap v4 _hamburger_ (which is a background SVG image). You can supply your own content (such as an icon) via the optionally scoped `default` slot. The default slot scope contains the property `expanded`, which will be `true` when the collapse is -expanded, or `false` when the collapse is collapsed. The `expanded` scope property only works when -supplying the `target` prop with a `string`, and not an `array`. +expanded, or `false` when the collapse is collapsed. -You can use this to swap the toggle content based on the collapse state: +Note that the `expanded` scope property only works when supplying the `target` prop as a `string`, +and not an `array`. ```html + ```