一、定义全局组建 二、在main.js文件中导入和使用 import TypeNav from '@/pages/Home/TypeNav' Vue.component('TyNav',TypeNav) 三、使用 <TyNav/>