import zhCn from '../es/locale/lang/zh-cn.mjs'; import nav from './components/navMenu.js'; // 2、定义路由 const routes = [ { path: '/foo', component: nav } ] // 获取路由方式 const history = VueRouter.createWebHistory() const router = VueRouter.createRouter({ history, routes }); const App = { data() { return { message: "Hello Element Plus" }; }, methods: { next() { if (this.active++ > 2) this.active = 0 } } }; const app = Vue.createApp(App); app.use(ElementPlus, { locale: zhCn }); app.use(router) // 挂载路由 app.mount("#app");