import { createRouter, createWebHashHistory } from 'vue-router'; import PopulationSearch from '../components/search/PopulationSearch.vue'; import HouseSearch from '../components/search/HouseSearch.vue'; import PopulationList from '../components/list/PopulationList.vue'; import HouseList from '../components/list/HouseList.vue'; import PopulationInfo from '../components/info/PopulationInfo.vue'; import HouseInfo from '../components/info/HouseInfo.vue'; const routes = [{ name: '以人找房搜索', path: '/population-search', component: PopulationSearch }, { name: '以房找人搜索', path: '/house-search', component: HouseSearch }, { name: '以房找人列表', path: '/population-list', component: PopulationList, }, { name: '以人找房列表', path: '/house-list', component: HouseList }, { name: '人口详情', path: '/population-info', component: PopulationInfo }, { name: '房屋详情', path: '/house-info', component: HouseInfo }] export const router = createRouter({ // 4. 内部提供了 history 模式的实现。为了简单起见,我们在这里使用 hash 模式。 history: createWebHashHistory(), routes, // `routes: routes` 的缩写 })