@anweb/nuxt-ancore 1.16.3 → 1.16.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { computed,
|
|
2
|
+
import { computed, ref, useTemplateRef, useId } from "vue";
|
|
3
3
|
import { onClickOutside, useEventListener } from "@vueuse/core";
|
|
4
4
|
const props = defineProps({
|
|
5
5
|
area: { type: String, required: false }
|
|
6
6
|
});
|
|
7
|
-
const id =
|
|
7
|
+
const id = useId();
|
|
8
8
|
const state = ref(false);
|
|
9
9
|
const refTarget = useTemplateRef("refTarget");
|
|
10
10
|
const toggle = (value) => {
|
|
@@ -20,12 +20,9 @@ const area = computed(() => {
|
|
|
20
20
|
return props.area || "bottom span-right";
|
|
21
21
|
});
|
|
22
22
|
const name = computed(() => {
|
|
23
|
-
return
|
|
24
|
-
});
|
|
25
|
-
const menuId = computed(() => id.value ? `an-dropdown-menu-${id.value}` : void 0);
|
|
26
|
-
onMounted(() => {
|
|
27
|
-
id.value = crypto.randomUUID();
|
|
23
|
+
return `--an-dropdown-${id}`;
|
|
28
24
|
});
|
|
25
|
+
const menuId = computed(() => `an-dropdown-menu-${id}`);
|
|
29
26
|
onClickOutside(refTarget, close);
|
|
30
27
|
useEventListener(document, "keydown", onKeydown);
|
|
31
28
|
defineExpose({ toggle, close });
|