1.父组件中导入NavBar组件 import NavBar from './commons/NavBar'; 2.在components中配置NavBar组件 components:{ NavBar }, 3.使用NavBar组件 <NavBar></NavBar>