0

我们有一个 Ionic-Vue 应用程序(Ionic 6 和 Vue 3)并尝试以编程方式打开一个 IonSelect。我们尝试使用这样的 ref:

 <ion-select ref="mySelect" placeholder="something" v-model="selectedIndex">
     <ion-select-option :value="1">One</ion-select-option>
     <ion-select-option :value="2">Two</ion-select-option>
 </ion-select>

我们确实可以像这样访问它:

myMethod(){
    console.log(this.$refs.mySelect);
}

但我们想不出任何打开它的方法。根据离子文档 [1] 应该有一个 open() 方法,但是

this.$refs.mySelect.open()

与“......不是一个功能”崩溃,所以这似乎并没有削减它。任何帮助表示赞赏。

[1] https://ionicframework.com/docs/api/select#methods

4

0 回答 0