-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
YSHOP2-1216: Added DropdownMenu component #245
Conversation
-m "Merged main to resolve conflicts"
|
||
const show = ref(false); | ||
const DropdownMenu = ref(); | ||
const toggleMenu = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Always separate refs from others
-m "Merged main to resolve conflicts"
-m "Merged main to update branch"
}); | ||
}; | ||
|
||
onClickOutside(DropdownMenuContainer, () => show.value = false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
onClickOutside(DropdownMenuContainer, () => show.value = false); | |
const handleScroll = () => { | |
show.value = false; | |
}; | |
onMounted(() => { | |
window.addEventListener('scroll', handleScroll); | |
}); | |
onUnmounted(() => { | |
window.removeEventListener('scroll', handleScroll); | |
}); | |
onClickOutside(DropdownMenuContainer, () => show.value = false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind to add scroll event to hide menu when user start scrolling
@@ -0,0 +1,85 @@ | |||
<script setup lang="ts"> | |||
import { nextTick, ref } from 'vue'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { nextTick, ref } from 'vue'; | |
import { nextTick, ref, onMounted, onUnmounted } from 'vue'; |
max-width: 100%; | ||
margin: 0; | ||
} | ||
</style> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think no need to create this component
What d u think?
Can we set the cursor to pointer on the items |
yeah sure |
JIRA Ticket
YSHOP2-1216
QA Steps
Note
Leave empty when you have nothing to say