get attrs: ƒ attrs()
get emit: emit() { return (event, …args) => {…}
get slots: ƒ slots()
proto: Object
}–>
setup(props, ctx) {
function iptChange(e) {
// ctx 这里通过emit来修改父组件中v-model的数据
ctx.emit(‘update:modelValue’, e.target.value)
}
return {
iptChange
}
}
}
在需要使用myInput的组件中