# gi-demo **Repository Path**: aleimu/gi-demo ## Basic Information - **Project Name**: gi-demo - **Description**: Gi Admin Pro 是一个基于 Vue3、Vite、TypeScript、Arco Design UI、Pinia、VueUse 的免费中后台模版,它使用了最新的前端技术栈,内置丰富的主题配置,有着极高的代码规范,基于mock实现的动态数据展示,开箱即用的模板,也可用于学习参考。 - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 441 - **Created**: 2022-09-22 - **Last Updated**: 2022-09-22 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README
## 安装使用
- 安装依赖
```bash
npm install
```
- 运行
```bash
npm run dev
```
- 打包
```bash
npm run build
```
## vs code插件安装
```bash
1. Prettier - Code formatter
2. Vue Language Features (Volar)
3. Vue 3 Snippets
4. TypeScript Vue Plugin (Volar)
```
## 注意
```bash
由于升级了vite3,根据官方规定,node版本必须是14.18.0以上
```
## 开源作者
**Lin**
## 交流
QQ:326010228
邮箱:326010228@qq.com
## 项目规范
> 接口api的命名
命名规范: 操作 + 后端模块名 + 功能名
~~~
/quota/getList => getQuotaList
/quota/getQuotaList => getQuotaList // 如果功能名包含了模块名,可省略
/user/save => saveUser
/user/list => getUserList // 如果没有操作名,可以自行根据场景补充
~~~
以上命名规范可以确保api命名不会冲突
引入接口
~~~js
import { getUserList, saveUser } from '@/apis'
~~~
> 页面变量命名 ()
~~~js
// 变量
const loading = ref(false) // 加载
const tableData = ref([]) // 表格数据
const showAddDialog = ref(false)
const showAddModal = ref(false)
const showEditDrawer = ref(false)
const form = reactive({
name: '',
phone: '',
remark: ''
})
const userList = []
const companyList = ref([]) // 列表数据最好后面加个 List 或者 Data
const checkedList = ref([])
const selectedList = ref([])
// 方法
编辑 onEdit handleEdit edit
新增 onAdd handleAdd add
删除 onDelete handleDelete delete
批量删除 onMulDelete handleMulDelete mulDelete
重命名 onRename
搜索 search
获取表格列表 getTableData // 一般一个页面也就一个表格,gi-demo习惯用getTableData, 结合分页hooks的时候可以直接复制复用
返回 back
提交 submit
确认 confirm ok submit
取消 cancel
关闭 close
保存 save
~~~
页面模板类名使用中划线
~~~vue