refactor: 重构商品列表和主页布局 style: 优化UI组件样式和交互效果 docs: 更新类型定义和路由配置 fix: 修复购物车商品重复问题 perf: 提升页面加载性能和响应速度 test: 添加商品详情页和搜索功能的测试用例 build: 更新依赖项以支持新功能 chore: 清理无用代码和文件
52 lines
900 B
TypeScript
52 lines
900 B
TypeScript
import { createRouter, createWebHistory } from 'vue-router'
|
|
|
|
// 导入组件
|
|
import Home from '../Views/Home.vue'
|
|
import Login from '../Views/Login.vue'
|
|
import Search from '../Views/Search.vue'
|
|
import ProductDetail from '../Views/product/productdetil.vue'
|
|
import Cart from '../Views/Cart.vue'
|
|
import Order from '../Views/Order.vue'
|
|
|
|
|
|
|
|
const routes = [
|
|
{
|
|
path: '/',
|
|
name: 'home',
|
|
component: Home
|
|
},
|
|
{
|
|
path: '/search',
|
|
name: 'search',
|
|
component: Search
|
|
},
|
|
{
|
|
path: '/product',
|
|
name: 'productDetail',
|
|
component: ProductDetail
|
|
},
|
|
{
|
|
path: '/login',
|
|
name: 'login',
|
|
component: Login
|
|
},
|
|
{
|
|
path: '/cart',
|
|
name: 'cart',
|
|
component: Cart
|
|
},
|
|
{
|
|
path: '/order',
|
|
name: 'order',
|
|
component: Order
|
|
},
|
|
]
|
|
|
|
const router = createRouter({
|
|
history: createWebHistory(import.meta.env.BASE_URL),
|
|
routes
|
|
})
|
|
|
|
export default router
|