1. 去菜单国际化
config\defaultSettings.ts
menu: {
locale: false,
},
2. umi3 / umi4 下 request 的不同
- “umi”: “^3.5.0”,
import { request } from 'umi';
export const fetch = async (api, data, method) => {
const info = {
method,
body: data,
headers: {
'Content-Type': 'application/json',
},
credentials: 'include',
};
if (method === 'get') {
delete info.body;
}
return request(api, info);
};
- “@umijs/max”: “^4.1.1”
import { request } from '@umijs/max';
export const fetch = async (api, data, method) => {
const info = {
method,
data,
headers: {
'Content-Type': 'application/json',
},
credentials: 'include', // fetch request with cookies
};
if (method === 'get') {
delete info.data;
}
return request(api, info);
};
3. 使用 :global 关键字修改 antd 组件样式
.custom-input {
:global {
.ant-input {
font-size: 12px;
}
}
}