Skip to content

Commit 70aa96c

Browse files
authored
Update README.md
1 parent 606aaf5 commit 70aa96c

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

src/components/popover/README.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,29 @@ Things to know when using popover component:
3636
- When triggered from hyperlinks that span multiple lines, popovers will be centered. Use
3737
`white-space: nowrap;` on your `<a>`s, `<b-link>`s and `<router-link>`s to avoid this behavior.
3838

39+
## Target
40+
41+
The target is the _trigger_ element (or component) that will trigger the popver. The target is
42+
specified via the `target` prop, and can be any of the following:
43+
44+
- A string identifying the ID of the trigger element (or ID of the root element of a component)
45+
- A reference (ref) to an `HTMLElement` or an `SVGElement` (e.g. via `this.$refs.refName`)
46+
- A reference (ref) to a component that has either an `HTMLElement` or `SVGElement` as its root
47+
element (e.g. via `this.$refs.refName`)
48+
- A function (callback) that returns a reference to an `HTMLElement` or `SVGElement`
49+
50+
For more information on references, see the official
51+
[Vue documentation](https://vuejs.org/v2/api/#vm-refs).
52+
53+
**Notes:**
54+
3955
The target element **must** exist in the document before `<b-popover>` is mounted. If the target
4056
element is not found during mount, the popover will never open. Always place your `<b-popover>`
41-
component lower in the DOM than your target element.
57+
component lower in the DOM than your target element. This rule also applies if a callback function
58+
is used as target element, since that callback is called only once on mount.
59+
60+
`HTMLElement` refers to standard HTML elements such as `<div>`, `<button>`, etc, while `SVGElement`
61+
refers to `<svg>` or supported child elements of SVGs.
4262

4363
## Positioning
4464

0 commit comments

Comments
 (0)