一、父组件给子组件传递数据
父组件传送data数据给子组件
<children :data="data">
子组件接收
export default {
props: ['data']
}
二、子组件操作父组件的方法
父组件定义一个show的方法,并且传达给子组件,命名为@show
<children @show="show"></children>
show(){
console.log('
父组件传送data数据给子组件
<children :data="data">
子组件接收
export default {
props: ['data']
}
父组件定义一个show的方法,并且传达给子组件,命名为@show
<children @show="show"></children>
show(){
console.log('