I am a certified trainer that likes to share my knowledge with the world.
Also, I am an adopter of continuous learning and evolving idea.
https://dev.to/wolfiton/who-am-i-3lj7
For making this easier to explain, I'm going to be using showing instead of show for the data in layouts/MainLayout.vue
I believe the issue is that when you use a <slot> the parent file that is passing in your slot values is the context that the slot contents will see. So when you click your menu button in your component, you're toggling show between true and false, but your slot is looking at the showing value.
There's also an issue where having a transition wrapping a transition will throw errors.
I am a certified trainer that likes to share my knowledge with the world.
Also, I am an adopter of continuous learning and evolving idea.
https://dev.to/wolfiton/who-am-i-3lj7
If you want to, it's always appreciated - but no need, I'm here to help 😄
As for your components being flexible, I think that depends on how you're planning to use them in the future - if you want to DM me and talk some more about this, feel free! My DMs should be open 🙂
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thanks for the link and ideas @tylerv, I really appreciated your input on my problem.
I am going to create a sandbox or codepen for this problem.
I created a codesandbox codesandbox link
So the following files are important here:
HorizontalMenu.vue
located insrc/components
MainLayout.vue
located insrc/layouts
App.vue
located insrc
For making this easier to explain, I'm going to be using
showing
instead ofshow
for the data inlayouts/MainLayout.vue
I believe the issue is that when you use a
<slot>
the parent file that is passing in your slot values is the context that the slot contents will see. So when you click your menu button in your component, you're togglingshow
between true and false, but your slot is looking at theshowing
value.There's also an issue where having a transition wrapping a transition will throw errors.
I forked your repo and have the transitions working here: codesandbox.io/s/serene-cori-kksi2
Thanks @tylerv for the help I will credit you in the github repo of the menu component, would that be alright with you?
Also, can I improve my component to make it more flexible in any way?(any suggestions regarding this idea)
Thanks again
If you want to, it's always appreciated - but no need, I'm here to help 😄
As for your components being flexible, I think that depends on how you're planning to use them in the future - if you want to DM me and talk some more about this, feel free! My DMs should be open 🙂