一个页面(以post 岗位管理 为例)由3部分组成
接口 /src/api/system/post/index.ts
页面和crud schemas /src/views/system/post/ [index.vue | post.data.ts]
其中api内index.ts 与 vue2 基本一致,只不过axios封装了get post put delete upload download 等方法,不用写method: 'get' 了
views中,index.vue 与 vue2 基本一致,本框架使用了vxe-table并封装了Search Table Form Descriptions等组件,当然也继续支持vue2的写法
post.data.ts 中主要是表单校验 rules 和表单 crudSchemas ,通过修改crudSchemas 就可以控制增删改查的字段、输入框还是下拉框等等
本框架集成了国际化,不需要的话可以自己想办法移除,使用方法如下
import { useI18n } from '@/hooks/web/useI18n'
const { t } = useI18n()
t('common.createTime')
并在src/locales 增加相应的中英文