tiny-vue/examples/docs/resources/pc/demo/checkbox/checkbox-events.vue

32 lines
692 B
Vue
Raw 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-checkbox-group v-model="checked" @change="valueChange">
<tiny-checkbox-button label="复选框1"></tiny-checkbox-button>
<tiny-checkbox-button label="复选框2"></tiny-checkbox-button>
</tiny-checkbox-group>
{{ logger }}
</div>
</template>
<script lang="jsx">
import { CheckboxButton, CheckboxGroup } from '@opentiny/vue'
export default {
components: {
TinyCheckboxButton: CheckboxButton,
TinyCheckboxGroup: CheckboxGroup
},
data() {
return {
checked: ['复选框1'],
logger: ''
}
},
methods: {
valueChange(val) {
this.logger = `当前选择${JSON.stringify(val)}`
}
}
}
</script>