tiny-vue/examples/sites/demos/pc/app/button-group/change-event-composition-ap...

22 lines
575 B
Vue
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<div>
<tiny-button-group :data="groupData" v-model="checkedVal" @change="handleChange"></tiny-button-group>
</div>
</template>
<script setup>
import { ref } from 'vue'
import { ButtonGroup as TinyButtonGroup, Modal } from '@opentiny/vue'
const checkedVal = ref('Button1')
const groupData = ref([
{ text: 'Button1', value: 'Button1' },
{ text: 'Button2', value: 'Button2' },
{ text: 'Button3', value: 'Button3' }
])
function handleChange(val) {
Modal.message({ message: `change事件触发了选中值为${val}`, status: 'info' })
}
</script>