mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
chore(): run build to update picker readme (#23822)
This commit is contained in:
@ -159,6 +159,63 @@ const PickerExample: React.FC = () => {
|
|||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
### Vue
|
||||||
|
|
||||||
|
```vue
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<ion-button @click="openPicker">SHOW PICKER</ion-button>
|
||||||
|
<p v-if="picked.animal">picked: {{ picked.animal.text }}</p>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { IonButton, pickerController } from "@ionic/vue";
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
IonButton,
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
pickingOptions: {
|
||||||
|
name: "animal",
|
||||||
|
options: [
|
||||||
|
{ text: "Dog", value: "dog" },
|
||||||
|
{ text: "Cat", value: "cat" },
|
||||||
|
{ text: "Bird", value: "bird" },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
picked: {
|
||||||
|
animal: "",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
async openPicker() {
|
||||||
|
const picker = await pickerController.create({
|
||||||
|
columns: [this.pickingOptions],
|
||||||
|
buttons: [
|
||||||
|
{
|
||||||
|
text: "Cancel",
|
||||||
|
role: "cancel",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: "Confirm",
|
||||||
|
handler: (value) => {
|
||||||
|
this.picked = value;
|
||||||
|
console.log(`Got Value ${value}`);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
await picker.present();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Properties
|
## Properties
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user