You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guide/getting-started.md
+35-24Lines changed: 35 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,11 +38,8 @@ Or use it on a case by case basis:
38
38
39
39
```html
40
40
<template>
41
-
<Popper>
41
+
<Poppercontent="This is the Popper content 🍿">
42
42
<button>Trigger element</button>
43
-
<template#content>
44
-
<div>This is the Popper content 🍿</div>
45
-
</template>
46
43
</Popper>
47
44
</template>
48
45
@@ -66,14 +63,30 @@ Add browser example
66
63
67
64
## Usage
68
65
69
-
You can add Popper to any of your elements or components. Just wrap them with `Popper` and use the `#content` slot for your popover:
66
+
You can add Popper to any of your elements or components. Just wrap them with `Popper` and use the `content` prop or slot for your popover.
67
+
68
+
### Using the content `prop`
69
+
70
+
If your content is only a simple string, you can use the `content` prop:
71
+
72
+
```vue
73
+
<template>
74
+
<Popper content="This is the Popper content">
75
+
<button>Trigger element</button>
76
+
</Popper>
77
+
</template>
78
+
```
79
+
80
+
### Using the content `slot`
81
+
82
+
If your content is more complex, you can use the `#content` slot:
70
83
71
84
```vue
72
85
<template>
73
86
<Popper>
74
-
<button>Trigger!</button>
87
+
<button>Trigger element</button>
75
88
<template #content>
76
-
<div>This is the content</div>
89
+
<div>This is the Popper content</div>
77
90
</template>
78
91
</Popper>
79
92
</template>
@@ -83,7 +96,7 @@ You can add Popper to any of your elements or components. Just wrap them with `P
83
96
84
97
`Popper` only comes with some barebones styling by default, but it also uses a list of predefined CSS variables. You can overwrite these variables to suit your needs.
0 commit comments