0

i am using vs-dropdown like below

    <vs-dropdown vs-custom-content vs-trigger-click class="cursor-pointer"  @click="dropdownClick($event)">
<feather-icon icon="BellIcon" class="cursor-pointer mt-1 sm:mr-6 mr-2" :badge="5" />

         <vs-dropdown-menu class="notification-dropdown dropdown-custom vx-navbar-dropdown">
            <li>1</li>
            <li>2</li>
          </vs-dropdown-menu>
    </vs-dropdown>
 

in methods

dropdownClick(event) {
          console.log("dropdownClick", event)  # undefined in the console and this method getting called two times  
},

so how get callback like opened or closed when vs-dropdown click?

madu kp
  • 89
  • 1
  • 7
  • Can you post your whole dropdown code? This would not show anything because there is no button – Dan Nov 22 '20 at 15:21
  • https://pixinvent.com/demo/vuexy-vuejs-admin-dashboard-template/documentation/components/dropDown.html#default – madu kp Nov 22 '20 at 15:39
  • When `vs-button` is alone, `@click` works properly, but not inside the dropdown, yet that's how the examples show it. So it seems they don't expect you to use `@click` with it. What do you need it to do besides show the dropdown anyway? – Dan Nov 22 '20 at 19:24
  • @Dan it is working fine like when i click bell icon dropdown is opening if i click again it is closing, but i want trigger some function when dropdown opens, how to? – madu kp Nov 23 '20 at 02:29
  • It seems bugged so I guess you'll have to ignore every 2nd event. As I said, it seems they don't expect you to trigger anything when the dropdown opens. What do you want to trigger? I can't think of any reason to trigger something when a dropdown opens – Dan Nov 23 '20 at 02:40
  • @Dan because I have to delete all message in DB so I need to call API when the drop-down opens for this I need a callback when the dropdown open but not on close – karnataka Nov 23 '20 at 05:24

0 Answers0