npm.io
1.0.0 • Published 8 years ago

vue-shop

Licence
GPL-3.0
Version
1.0.0
Deps
12
Vulns
1
Weekly
0

vue-shop

基于 vue-jd

安装

  1. 下载项目
git clone https://github.com/viosey/vue-shop.git
  1. 在 MySQL 中导入 vue-shop.sql 文件

运行

  1. 修改数据库配置:

route/index.js

自行修改 host, user, password database

const db = mysql.createPool({
    host: 'localhost',
    user: 'root',
    password: 'root',
    database: 'vue-shop'
});
  1. 进入项目目录:
cd vue-shop
  1. 安装依赖:
npm install
  1. 开启后台服务:
node server.js
  1. 运行 dev 模式:
npm run dev

目录结构

.
├── README.md           
├── libs               		// 后台常用工具模块的封装, 比如格式化事件、MD5 加密等
├── route              		// 后台接口的编写目录
├── server.js          		// 后台服务的配置文件
├── webpack.config.js  		// webpack 配置文件
├── index.html         		// 项目入口文件
├── package.json       		// 项目配置文件
├── src                		// 生产目录
│   ├── assets         		// css, js, fonts, images 资源
│   ├── components     		// 各种 vue 组件
│   ├── store          		// vuex 状态管理器
│   ├── App.vue        		// 项目中全局 vue
│   ├── main.js        		// webpack 预编译入口
│   └── router.config.js    // vue 路由配置文件

架构

前端
服务端
  • Node.js
  • Express 中间件进行服务的配置,路由、请求的处理
  • body-parser: 中间件进行前端请求参数的获取
  • cookie-parser, cookie-session: cookie 与 session 的处理
数据库
  • MySQL