https://primefaces.org/primevue/showcase/#/selectbutton
I expect the model value as a prop and want to emit the selected value back to the parent component.
Code: Select all
<template>
<p-select-button
:modelValue="modelValue"
:options="options"
/>
<!-- Lacks change event handler -->
</template>
<script lang="ts">
import { defineComponent, ref } from "vue";
export default defineComponent({
props: {
modelValue: String,
},
setup() {
const options = ref(['On', 'Off']);
// Lacks change event handler to emit event to parent component
return { options };
},
});
</script>