HzInput.vue
<template>
<el-input ref="inputRef" v-bind="$attrs">
<template v-for="(slot, slotName) in $slots" #[slotName]="slotProps">
<slot :name="slotName" v-bind="slotProps || {}"></slot>
</template>
</el-input>
</template>
<script>
export default {
mounted(){
const entries = Object.entries(this.$refs.inputRef)
for (const [key, value] of entries) {
this[key] = value
}
}
}
</script>