0

value: 'Select (mm)',
list: ["1mm","2mm","3mm", "4mm", "55mm"],
visible: false,
      
     toggle() {
      this.visible = !this.visible;
    },
    select(option) {
        this.value = option;
    },
<div class="thickness-productlist">CLEAR</div> 
 
 <div class="aselect" :data-value="value" :data-list="list">
        <div class="selector" @click="toggle()">
            <div class="label">
                    <span>{{ value }}</span>
            </div>
            <div class="arrow" :class="{ expanded : visible }"></div>
            <div :class="{ hidden : !visible, visible }">
                <ul>
                    <li :class="{ current : item === value }" v-for="item in list" 
                  @click="select(item)" :key="item">{{ item }}</li>
                </ul>
            </div>
        </div>
    </div>

How to reset selected value from the dropdown on clicking of clear button in vuejs?

At present i am having the clear option, Where if i click on it, I want to selected value from the dropdown to get clear.

1 Answer 1

1

the dropdown selected value is binded to the value variable so listen to the click event and change it back

<div class="thickness-productlist" @click="value= 'Select (mm)'">CLEAR</div> 
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.