mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-11-09 13:53:38 +08:00
refactor: use setup refactor
This commit is contained in:
@@ -10,7 +10,6 @@ class algorithmProxy implements ProxyAlgorithm {
|
||||
return Object.keys(val)
|
||||
.map(v => {
|
||||
return {
|
||||
// @ts-ignore
|
||||
...val[v],
|
||||
key: v
|
||||
};
|
||||
|
||||
@@ -5,7 +5,8 @@ import { excludeProps } from "./utils";
|
||||
*/
|
||||
export const defaultConfig: AxiosRequestConfig = {
|
||||
baseURL: "",
|
||||
timeout: 10000, //10秒超时
|
||||
//10秒超时
|
||||
timeout: 10000,
|
||||
headers: {
|
||||
Accept: "application/json, text/plain, */*",
|
||||
"Content-Type": "application/json",
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
export const hasClass = (ele: Element, cls: string): any => {
|
||||
export const hasClass = (ele: RefType<any>, cls: string): any => {
|
||||
return !!ele.className.match(new RegExp("(\\s|^)" + cls + "(\\s|$)"));
|
||||
};
|
||||
|
||||
export const addClass = (ele: Element, cls: string, extracls?: string): any => {
|
||||
export const addClass = (
|
||||
ele: RefType<any>,
|
||||
cls: string,
|
||||
extracls?: string
|
||||
): any => {
|
||||
if (!hasClass(ele, cls)) ele.className += " " + cls;
|
||||
if (extracls) {
|
||||
if (!hasClass(ele, extracls)) ele.className += " " + extracls;
|
||||
@@ -10,7 +14,7 @@ export const addClass = (ele: Element, cls: string, extracls?: string): any => {
|
||||
};
|
||||
|
||||
export const removeClass = (
|
||||
ele: Element,
|
||||
ele: RefType<any>,
|
||||
cls: string,
|
||||
extracls?: string
|
||||
): any => {
|
||||
|
||||
@@ -2,11 +2,16 @@ import NProgress from "nprogress";
|
||||
import "nprogress/nprogress.css";
|
||||
|
||||
NProgress.configure({
|
||||
easing: "ease", // 动画方式
|
||||
speed: 500, // 递增进度条的速度
|
||||
showSpinner: true, // 是否显示加载ico
|
||||
trickleSpeed: 200, // 自动递增间隔
|
||||
minimum: 0.3 // 初始化时的最小百分比
|
||||
// 动画方式
|
||||
easing: "ease",
|
||||
// 递增进度条的速度
|
||||
speed: 500,
|
||||
// 是否显示加载ico
|
||||
showSpinner: true,
|
||||
// 自动递增间隔
|
||||
trickleSpeed: 200,
|
||||
// 初始化时的最小百分比
|
||||
minimum: 0.3
|
||||
});
|
||||
|
||||
export default NProgress;
|
||||
|
||||
Reference in New Issue
Block a user