Christmas Sale! Limited Time Only - Enjoy 30% Off Metronic Extended License!
Buy for 669$  969$

Vue 3 - Loading Dropdown Menu does not work properly


When I use a v-if="toolbarStatus" in the first DIV element, it does shows the button, but it does not shows the Dropdown3 elements. This only happens when I'm from route "A" going to end route "B" which loads the Toolbar. Does this have to do with router-link which I'm using in route A to get to route B?

If I just directly go to the end route or refresh it, it works perfectly.


<div class="card-toolbar" v-if="toolbarStatus">
<!--begin::Menu-->
<button
type="button"
class="btn btn-sm btn-icon btn-color-primary btn-active-light-primary"
data-kt-menu-trigger="click"
data-kt-menu-placement="bottom-end"
data-kt-menu-flip="top-end"
>
<span class="svg-icon svg-icon-2">
<inline-svg
src="media/icons/duotone/Layout/Layout-4-blocks-2.svg"
/>
</span>
</button>
<Dropdown3></Dropdown3>
<!--end::Menu-->
</div>


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (13)


Searching for a water filtration plant near me? Aquafiltrum connects you with high-quality systems for convenient and efficient water purification in your area.



Experience Dubai with the best tour agency in Dubai! We offer personalized cultural tours, showcasing the city’s historic sites, lively souks, and must-see landmarks for an unforgettable journey.



Noorani Qaida Online - Learn the Noorani Qaida online with QudratUllah. Our accessible resources and materials make it convenient for you to practice and improve your Quranic reading skills from the comfort of your home. Start your journey today!

Experience the convenience and power of Delta executor APK for all your gaming needs!



Our skin peeling therapy options are customized to meet your unique skincare needs. We tailor each therapy to address your individual skin type and concerns, ensuring the best possible results.


Deleted comment

Drift hunters is a game that delivers pure excitement and fun. The realistic physics and stunning visuals create an immersive drifting experience.

Are you looking for an entertaining game to relieve stress and pressure in life? Try Geometry Dash Scratch, the player controls a square block that moves automatically through challenging levels, avoiding obstacles and collecting items. Each level will have different scenes and lyrics, you can conquer and challenge yourself.



Discover the latest collection of Embroidered chiffon dresses. Perfect for any occasion, these elegant and stylish dresses will make you stand out from the crowd. Stay fashionable with Fiza Minahil



Hi,

v-if will hide elements with all child elements. If your first div element is hidden when your button and dropdown components will be hidden as well.

Could you please specify what you want to display on your page?



Lauris, the button is shown as the value of toolbarStatus is true. It renders. But if I click on the element (button). It does not show the dropdown.



Sorry for the misunderstanding.

You can try to reinitialize MenuComponent in your vue component.

MenuComponent.reinitialization();



Hi Lauris,
A great thanks for that tip. It has just saved ma day.
Please can you give more explanations about why we have to do that so it works??
Thanks again



I just checked it deeper. It look like the click function is not being detected.


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(