Emit handle in vue3?
Как изменять пропсы через emit (vue3) Child
<template>
<CaButton
:background="isChoose ? '#2437DB' : '#EFF2F5'"
@click="handleClickChoose"
>
<div>
{{ title }}
</div>
<div v-if="isChoose" style="width: 9px; height: 9px;">
<img :src="icon" alt="icon" >
</div>
</CaButton>
</template>
<script>
export default {
name: 'ButtonChip',
props: {
title: {
type: String,
default: '',
},
isChoose: {
type: Boolean,
default: false,
},
},
emits: ['myEvent'],
methods: {
handleClickChoose() {
this.$emit('myEvent');
},
},
};
Parent
<ButtonChip
title="ass"
@my-event="handleChoose"
>
</ButtonChip>