向外发送点击关闭按钮的事件
:visible.sync="cropperVisible"
this.$emit('update:visible', false)
<!-- 父组件 -->
<li v-for="(item, index) in list" :key="index">
<!-- 多值 接收 -->
<child @test="getChild(arguments, index)"></child>
<!-- 单值 接收 -->
<!-- <child @test="getChild($event, index)"></child> -->
</li>
<!-- 子组件 -->
<template>
<div>
<button @click="toFather">提交</button>
</div>
</template>
<script>
export default {
data: {
return {
value1: '值1',
value2: '值2',
value3: '值3'
}
},
methods: {
toFather() {
this.$emit("test", value1);
},
},
}
</script>