vue wants to pass values to child components through prop. The value bound by the parent component has a default value. It is hoped that after the data is returned by the axios background, extend more objects on its own data and then pass it to the child component. How to solve this problem?
<template>
<a-component :opt="opt" ></a-component>
</template>
<script>
export default{
data(){
return {
opt:{
a:1,
b:2
}
}
},
methods:{
getList(){
axios.get("").then(function (res) {
_.extend(_this.opt,{
c:3,d:4
})
})
//debuggercreatedoptopt
}
}
}
</script>