商城项目 前端

1. 基本配置

1.1. 关闭eslint

编辑 config/index.js

1
useEslint: false

2. 品牌管理

  • 参考Example

2.1. 添加路由和侧边栏

编辑 router/index.js

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{
path: '/brand',
component: Layout,
redirect: '/brand/list',
name: 'Brand',
meta: {
title: '品牌管理',
icon: 'example'
},
children: [
{
path: 'create',
component: () => import('@/views/brand/create'),
name: 'CreateBrand',
meta: { title: '创建品牌', icon: 'edit' }
},
{
path: 'edit/:id(\\d+)',
component: () => import('@/views/brand/edit'),
name: 'EditBrand',
meta: { title: '编辑品牌', noCache: true },
hidden: true
},
{
path: 'list',
component: () => import('@/views/brand/list'),
name: 'BrandList',
meta: { title: '品牌列表', icon: 'list' }
}
]
},

2.2. 添加组件文件

复制@/views/example目录,得到@/views/brand

2.3. 添加API接口文件

复制@/api/article.js,得到@/api/brand.js

2.4. list.vue 品牌列表页

panchaoxin wechat
关注我的公众号
支持一下