Topic: How can a mdb-dropdown behave as a selector in the navigation bar?

watchdog premium asked 5 years ago


Expected behavior When an mdb-dropdown item selected, an action is called, and a new value assigned to the mdb-dropdown-toggle. Similar to the typical select/options component. Changing 'Basic dropdown' to 'Action', when the first item is selected.

Actual behavior Can not figure out how to assign a new value.

Resources (screenshots, code snippets etc.)

<template>
  <mdb-dropdown>
    <mdb-dropdown-toggle slot="toggle">Basic dropdown</mdb-dropdown-toggle>
    <mdb-dropdown-menu>
      <mdb-dropdown-item>Action</mdb-dropdown-item>
      <mdb-dropdown-item>Another action</mdb-dropdown-item>
      <mdb-dropdown-item>Something else here</mdb-dropdown-item>
      <div class="dropdown-divider"></div>
      <mdb-dropdown-item>Separated link</mdb-dropdown-item>
    </mdb-dropdown-menu>
  </mdb-dropdown>
</template>

Magdalena Dembna staff answered 5 years ago


Hi, mdb-dropdown-item by default is rendered as component and supports properties such as href, disables, active, disabled and newTab. It doesn't emit a value, so if you wish to assign and select values , I would suggest using mdb-select: https://mdbootstrap.com/docs/vue/forms/select/ Kind regards, Magdalena



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Premium
  • Premium support: Yes
  • Technology: MDB Vue
  • MDB Version: 5.1.1
  • Device: Web
  • Browser: Chrome
  • OS: Mac OS
  • Provided sample code: No
  • Provided link: No