1

I need to listen changes in bootstrap dropdown element (button)

<div class="dropdown">
  <button 
    class="btn btn-secondary dropdown-toggle" 
    type="button" 
    id="dropdownMenuButton" 
    data-toggle="dropdown" 
    aria-haspopup="true" 
    aria-expanded="false">
    USD
  </button>
  <div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
    <button class="dropdown-item">USD</a>
    <button class="dropdown-item">EUR</a>
  </div>
</div>

and transmit selected value into Vue component. How can I do this?

1 Answer 1

1
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
    <button @click="select('USD')" class="dropdown-item">USD</a>
    <button @click="select('EUR')" class="dropdown-item">EUR</a>
</div>


select(val){
    this.val = val
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.