@@ -36,9 +36,29 @@ Things to know when using popover component:
36
36
- When triggered from hyperlinks that span multiple lines, popovers will be centered. Use
37
37
` white-space: nowrap; ` on your ` <a> ` s, ` <b-link> ` s and ` <router-link> ` s to avoid this behavior.
38
38
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
+
39
55
The target element ** must** exist in the document before ` <b-popover> ` is mounted. If the target
40
56
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.
42
62
43
63
## Positioning
44
64
0 commit comments