用$ref调用直接代码:子组件:父组件父组件: 在子组件中加上ref即可通过this.$refs.ref.method调用
子组件在props中定义数据,然后父组件传数据过去,例如:子组件:props: {show: {default: false}}父组件://test是子组件名字parentShow是父组件定义的data数据