Problems with mint-ui Picker components

questions about mint-ui Picker components
I am now in such a business scenario, click a button and pop up a picker for the user to choose from. Picker has several options

slots: [{values: ["", "", "", "", "", ""]}]

when I want to listen for changes to the data, I get which value the user chose. When the user clicks the button for the first time, then Picker pops up. If he just wants to choose the first option, "Shenzhen", then he clicks on picker this time will not trigger the onValueChange event, I will not know that he chose the first option.
mt-picker doesn"t seem to bind v-model automatically, you need to set the value manually through the onValueChange event, but how to solve this situation now?

Jun.22,2022

I have also encountered this problem, and I have not found a relatively simple solution yet. I am currently recording the value of value with a variable with an initial value of null in onvaluechange. When closing picker, determine if this variable is still null (that is, the onvaluechange function is not triggered), choose the first option.


if the value in slots is an object, can it be implemented

slots: [
 {
    values: [
    {value: '' , id:'2adsfa2323'},
    {value: '' , id:'2adsfa2323'}
    ]
 }
]

you can choose the first item by default at the beginning, such as

 onValuesChange(picker, values) {
            if (this.isFirstSelect === true) { //
                setTimeout(() => { //
                    picker.setValue(0, firstValue); //
                }, 10);
                this.isFirstSelect = false;
            }
        },

this problem can be solved by leaving the selected content and data source empty after being checked or unchecked.

Menu