|
@@ -10,6 +10,10 @@ const props = defineProps({
|
|
|
type: Array,
|
|
|
default: []
|
|
|
},
|
|
|
+ activeItem: {
|
|
|
+ type: Object,
|
|
|
+ default: () => ({})
|
|
|
+ }
|
|
|
});
|
|
|
|
|
|
const emit = defineEmits(['onClick', 'onEnter']);
|
|
@@ -24,8 +28,8 @@ const inpRef = ref(null);
|
|
|
const isFocusState = ref(false);
|
|
|
|
|
|
const isOpen = ref(false);
|
|
|
-const selectedOption = ref(null);
|
|
|
const highlightedIndex = ref(0);
|
|
|
+const selectedOption = ref(null);
|
|
|
|
|
|
const popoverTriggerRef = ref(null);
|
|
|
const popoverInnerRef = ref(null);
|
|
@@ -48,6 +52,10 @@ watch(inpVal, (curVal) => {
|
|
|
// isOpen.value = (curVal === "@" && curVal.length === 1);
|
|
|
})
|
|
|
|
|
|
+watch(() => props.activeItem, (curVal) => {
|
|
|
+ selectedOption.value = curVal?.tools ? curVal : null;
|
|
|
+})
|
|
|
+
|
|
|
const handleInpFocus = () => {
|
|
|
inpRef.value?.focus();
|
|
|
}
|