|
|
|
@ -244,17 +244,30 @@ const clickmenu = (index) => { |
|
|
|
activeIndex.value = activeIndex.value === index ? -1 : index; |
|
|
|
} |
|
|
|
|
|
|
|
const resetSelect = () => { |
|
|
|
selectedValue.value = ''; // 重置选中值 |
|
|
|
selectedItem.value = ''; // 重置显示文本 |
|
|
|
isOpen.value = false; // 关闭下拉菜单 |
|
|
|
coinisOpen.value = false; // 关闭金币产品子菜单 |
|
|
|
productisOpen.value = false; // 关闭软件产品子菜单 |
|
|
|
activeIndex.value = -1; // 关闭二级菜单 |
|
|
|
}; |
|
|
|
|
|
|
|
watch(() => props.modelValue, (newVal) => { |
|
|
|
selectedItem.value = newVal; |
|
|
|
selectedValue.value = newVal; |
|
|
|
}, { immediate: true }); |
|
|
|
onMounted(async () => { |
|
|
|
console.log('打开组件', props.modelValue); |
|
|
|
selectedValue.value = props.modelValue; |
|
|
|
selectedItem.value = selectedValue.value || ''; |
|
|
|
document.addEventListener('click', handleGlobalClick); // 绑定全局事件 |
|
|
|
}); |
|
|
|
onUnmounted(() => { |
|
|
|
selectedValue.value = ''; |
|
|
|
document.removeEventListener('click', handleGlobalClick); // 解绑全局事件 |
|
|
|
}); |
|
|
|
defineExpose({ resetSelect }); |
|
|
|
</script> |
|
|
|
<style scoped lang="scss"> |
|
|
|
.productContent { |
|
|
|
@ -426,6 +439,7 @@ onUnmounted(() => { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.fistlevel.selected .label { |
|
|
|
color: #175BE5; |
|
|
|
} |
|
|
|
|