Issue
I want to execute a codeblock every time the value of my ion-select
changes.
The documentation provides an ionChange
event for that.
When I try to execute it, nothing happens.
I tried ionFocus
and it works but i need the ionChange
event to work.
<ion-select @ionChange="changeUnit('ionChange')" @ionFocus="changeUnit('ionFocus')" interface="popover" placeholder="required">
<ion-select-option value="m3">m3</ion-select-option>
<ion-select-option value="m2">m2</ion-select-option>
<ion-select-option value="ml">ml</ion-select-option>
<ion-select-option value="kg">kg</ion-select-option>
</ion-select>
changeUnit(value){
console.log(value);
}
Do I miss something? Why does the ionFocus
work but the ionChange
not?
I'm using ionic 5 and vue 3.
I also use an emitter from mitt
in the same component.
But this also doesn't interfere with the ionFocus
event.
Solution
make sure you have imported and added to components
IonSelect,
IonSelectOption
Answered By - Aaron Saunders
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.