父组件 <script> import helloworld from "../components/HelloWorld"; provide() { return { msg: "provide数据", fns() { console.log(111); } }; }, </script> 子组件 <div>{{ msg }}</div><!--父组件的msg--> <script> inject: ["msg","fns"], mounted() { this.fns();//父组件方法 } </script>