v-model为:modelValue和@update:modelValue的简写
父组件
<ChannelSelect v-model="cateId"></ChannelSelect>
子组件
<script setup>
defineProps({
modelValue: {
type: [Number, String]
}
})
const emit = defineEmits(['update:modelValue'])
</script>
<template>
<el-select
:modelValue="modelValue"
@update:modelValue="emit('update:modelValue', $event)"
>
</el-select>
</template>