父组件
<template>
<view class="content">
{{test}}
<aaa v-model="test"></aaa>
</template>
子组件
<template>
<!-- <input @input="inputChange" :value="value"></input> -->
</template>
<script>
export default {
props: {
value: String
},
data () {
return {
}
},
mounted () {
this.$emit("input","test")
}
}
</script>
<style>
</style>
父组件通过v-model给子组件传值,子组件通过props里的value接受传递的值。子组件注册input方法,父组件可以实时监听到子组件的传值
浙公网安备 33010602011771号