mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-08-27 09:18:33 +08:00
feat: add VbenForm component (#4352)
* feat: add form component * fix: build error * feat: add form adapter * feat: add some component * feat: add some component * feat: add example * feat: suppoer custom action button * chore: update * feat: add example * feat: add formModel,formDrawer demo * fix: build error * fix: typo * fix: ci error --------- Co-authored-by: jinmao <jinmao88@qq.com> Co-authored-by: likui628 <90845831+likui628@users.noreply.github.com>
This commit is contained in:
@@ -5,7 +5,7 @@ import type {
|
||||
CreateAxiosDefaults,
|
||||
} from 'axios';
|
||||
|
||||
import { merge } from '@vben/utils';
|
||||
import { bindMethods, merge } from '@vben/utils';
|
||||
|
||||
import axios from 'axios';
|
||||
|
||||
@@ -44,7 +44,7 @@ class RequestClient {
|
||||
const requestConfig = merge(axiosConfig, defaultConfig);
|
||||
this.instance = axios.create(requestConfig);
|
||||
|
||||
this.bindMethods();
|
||||
bindMethods(this);
|
||||
|
||||
// 实例化拦截器管理器
|
||||
const interceptorManager = new InterceptorManager(this.instance);
|
||||
@@ -61,21 +61,6 @@ class RequestClient {
|
||||
this.download = fileDownloader.download.bind(fileDownloader);
|
||||
}
|
||||
|
||||
private bindMethods() {
|
||||
const propertyNames = Object.getOwnPropertyNames(
|
||||
Object.getPrototypeOf(this),
|
||||
);
|
||||
propertyNames.forEach((propertyName) => {
|
||||
const propertyValue = (this as any)[propertyName];
|
||||
if (
|
||||
typeof propertyValue === 'function' &&
|
||||
propertyName !== 'constructor'
|
||||
) {
|
||||
(this as any)[propertyName] = propertyValue.bind(this);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* DELETE请求方法
|
||||
*/
|
||||
|
Reference in New Issue
Block a user