diff --git a/docs/components/content/examples/DropdownExampleOpen.vue b/docs/components/content/examples/DropdownExampleOpen.vue new file mode 100644 index 00000000..771878e1 --- /dev/null +++ b/docs/components/content/examples/DropdownExampleOpen.vue @@ -0,0 +1,22 @@ + + + diff --git a/docs/content/2.elements/6.dropdown.md b/docs/content/2.elements/6.dropdown.md index 74d99e1c..4182898c 100644 --- a/docs/content/2.elements/6.dropdown.md +++ b/docs/content/2.elements/6.dropdown.md @@ -34,6 +34,12 @@ Use the `mode` prop to switch between `click` and `hover` modes. :component-example{component="dropdown-example-mode"} +### Manual :u-badge{label="New" class="align-middle ml-2 !rounded-full" variant="subtle"} + +Use a `v-model:open` to manually control the state. In this example, press :shortcut{value="O"} to toggle the dropdown. + +:component-example{component="dropdown-example-open"} + ## Popper Use the `popper` prop to customize the popper instance. diff --git a/src/runtime/components/elements/Dropdown.vue b/src/runtime/components/elements/Dropdown.vue index 35543fc3..8c9c7b42 100644 --- a/src/runtime/components/elements/Dropdown.vue +++ b/src/runtime/components/elements/Dropdown.vue @@ -1,4 +1,5 @@