// src/router/index.js
import { createRouter, createWebHistory } from 'vue-router';

// 导入页面组件
import HomePage from '../components/index.vue';
import PreferencePage from '../components/PreferenceForm.vue';
import ResultPage from '../components/Recommenduser.vue';

// 定义路由规则
const routes = [
  {
    path: '/', // 默认主页
    name: 'Home',
    component: HomePage,
  },
  {
    path: '/preference', // 恋爱偏好页
    name: 'Preference',
    component: PreferencePage,
  },
  {
    path: '/result', // 查看结果页
    name: 'Result',
    component: ResultPage,
  },
];

// 创建路由实例
const router = createRouter({
  history: createWebHistory(), 
  routes, // 确保包含路由配置
});

export default router;
