import {createRouter, createWebHashHistory, createWebHistory} from 'vue-router' import IndexView from '../views/IndexView.vue' const routes = [ { path: '/', // '/index', name: 'IndexView', component: IndexView } ] const router = createRouter({ history: createWebHashHistory(), // “/#/” routes: routes // 可简写为 routes }) export default router