Commit 37a82ad 1 parent e008bb5 commit 37a82ad Copy full SHA for 37a82ad
File tree 2 files changed +34
-36
lines changed
2 files changed +34
-36
lines changed Original file line number Diff line number Diff line change 1
1
<script setup lang="ts">
2
- // This starter template is using Vue 3 <script setup> SFCs
3
- // Check out https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup
4
2
import SimpleDropdown from ' @/VueSimpleDropdown.vue'
5
3
import { ref } from ' vue'
6
4
@@ -11,7 +9,36 @@ const example = ref('vue-simple-dropdown')
11
9
<div class =" container mx-auto px-4" >
12
10
<div h1 class =" text-3xl font-bold pt-4" >Playground for {{ example }}</div >
13
11
<div class =" mt-4" >
14
- <SimpleDropdown class =" inline" />
12
+ <SimpleDropdown class =" inline" popper-class =" border rounded" >
13
+ <!-- This will be the popover reference (for the events and position) -->
14
+ <button
15
+ class =" inline-block px-6 py-2.5 bg-blue-600 text-white leading-tight rounded hover:bg-blue-700 focus:bg-blue-700 focus:outline-none focus:ring-0 active:bg-blue-800 transition duration-150 ease-in-out"
16
+ >
17
+ Click me
18
+ </button >
19
+
20
+ <!-- This will be the content of the popover -->
21
+ <template #popper =" { hide } " >
22
+ <div class =" w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700" >
23
+ <ul class =" py-1 text-sm text-gray-700 dark:text-gray-200" >
24
+ <li >
25
+ <a href =" #" class =" block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white" @click =" hide"
26
+ >Dashboard</a
27
+ >
28
+ </li >
29
+ <li >
30
+ <a href =" #" class =" block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white" >Settings</a >
31
+ </li >
32
+ <li >
33
+ <a href =" #" class =" block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white" >Earnings</a >
34
+ </li >
35
+ <li >
36
+ <a href =" #" class =" block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white" >Sign out</a >
37
+ </li >
38
+ </ul >
39
+ </div >
40
+ </template >
41
+ </SimpleDropdown >
15
42
</div >
16
43
</div >
17
44
</template >
Original file line number Diff line number Diff line change 1
1
<template >
2
- <BaseDropdown :distance =" 14" placement =" bottom-start" :triggers =" ['click']" auto-hide popper-class =" border rounded" >
3
- <!-- This will be the popover reference (for the events and position) -->
4
- <button
5
- class =" inline-block px-6 py-2.5 bg-blue-600 text-white leading-tight rounded hover:bg-blue-700 focus:bg-blue-700 focus:outline-none focus:ring-0 active:bg-blue-800 transition duration-150 ease-in-out"
6
- >
7
- Click me
8
- </button >
9
-
10
- <!-- This will be the content of the popover -->
11
- <template #popper =" { hide } " >
12
- <div class =" w-44 bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700" >
13
- <ul class =" py-1 text-sm text-gray-700 dark:text-gray-200" >
14
- <li >
15
- <a href =" #" class =" block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white" @click =" hide"
16
- >Dashboard</a
17
- >
18
- </li >
19
- <li >
20
- <a href =" #" class =" block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white" >Settings</a >
21
- </li >
22
- <li >
23
- <a href =" #" class =" block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white" >Earnings</a >
24
- </li >
25
- <li >
26
- <a href =" #" class =" block py-2 px-4 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white" >Sign out</a >
27
- </li >
28
- </ul >
29
- </div >
2
+ <BaseDropdown :distance =" 14" placement =" bottom-start" :triggers =" ['click']" auto-hide >
3
+ <template v-for =" (_ , slot ) in $slots " #[slot ]=" scope " >
4
+ <slot :name =" slot" v-bind =" scope || {}" />
30
5
</template >
31
6
</BaseDropdown >
32
7
</template >
33
8
34
9
<script setup lang="ts">
35
- import ' floating-vue/dist/style.css'
36
-
37
10
import BaseDropdown from ' ./BaseDropdown.vue'
38
- import { ref } from ' vue'
39
-
40
- const msg = ref (' hello' )
11
+ import ' floating-vue/dist/style.css'
41
12
</script >
42
13
43
14
<style >
You can’t perform that action at this time.
0 commit comments