优化更新
This commit is contained in:
@@ -116,11 +116,12 @@ export function useLockFn(fn: (...args: any[]) => Promise<any>) {
|
||||
```typescript
|
||||
// src/views/system/position/edit.vue
|
||||
import { useLockFn } from '@/utils/useLockFn';
|
||||
import { message } from 'ant-design-vue';
|
||||
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate();
|
||||
props.positionId ? await positionUpdate(formData) : await positionAdd(formData);
|
||||
message('操作成功');
|
||||
message.success('操作成功');
|
||||
emit('update:visible', false);
|
||||
emit('success');
|
||||
};
|
||||
@@ -130,7 +131,7 @@ const { isLock: subLoading, lockFn: submit } = useLockFn(handleSubmit);
|
||||
```
|
||||
|
||||
```vue
|
||||
<el-button :loading="subLoading" type="primary" @click="submit">确定</el-button>
|
||||
<a-button :loading="subLoading" type="primary" @click="submit">确定</a-button>
|
||||
```
|
||||
|
||||
## useAsync
|
||||
|
||||
Reference in New Issue
Block a user