mirror of
https://github.com/jekip/naive-ui-admin.git
synced 2026-02-11 16:52:28 +08:00
支持 Vue 3.2.x 语法升级为,script setup
This commit is contained in:
@@ -14,7 +14,7 @@ const params = {
|
||||
flag: false,
|
||||
};
|
||||
|
||||
const startDrag = function (bar, target, callback) {
|
||||
const startDrag = function (bar, target, callback?) {
|
||||
const screenWidth = document.body.clientWidth; // body当前宽度
|
||||
const screenHeight = document.documentElement.clientHeight; // 可见区域高度
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ const transform: AxiosTransform = {
|
||||
* @description: 处理请求数据
|
||||
*/
|
||||
transformRequestData: (res: AxiosResponse<Result>, options: RequestOptions) => {
|
||||
// @ts-ignore
|
||||
const { $message: Message, $dialog: Modal } = window;
|
||||
const {
|
||||
isShowMessage = true,
|
||||
@@ -186,6 +187,7 @@ const transform: AxiosTransform = {
|
||||
* @description: 响应错误处理
|
||||
*/
|
||||
responseInterceptorsCatch: (error: any) => {
|
||||
// @ts-ignore
|
||||
const { $message: Message, $dialog: Modal } = window;
|
||||
const { response, code, message } = error || {};
|
||||
// TODO 此处要根据后端接口返回格式修改
|
||||
|
||||
@@ -12,8 +12,6 @@ export interface RequestOptions {
|
||||
joinParamsToUrl?: boolean;
|
||||
// 格式化请求参数时间
|
||||
formatDate?: boolean;
|
||||
// 是否处理请求结果
|
||||
isTransformResponse?: boolean;
|
||||
// 是否显示提示信息
|
||||
isShowMessage?: boolean;
|
||||
// 是否解析成JSON
|
||||
|
||||
@@ -41,6 +41,7 @@ export function generatorMenu(routerMap: Array<any>) {
|
||||
...info.meta,
|
||||
label: info.meta?.title,
|
||||
key: info.name,
|
||||
icon: isRoot ? item.meta?.icon : info.meta?.icon,
|
||||
};
|
||||
// 是否有子菜单,并递归处理
|
||||
if (info.children && info.children.length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user