mirror of
https://github.com/vbenjs/gf-vben-admin.git
synced 2025-01-23 11:50:20 +08:00
chore: bump 2.0.0-rc.11
This commit is contained in:
parent
be2b8a7e17
commit
ea24dfa384
@ -1,3 +1,32 @@
|
||||
## 2.0.0-rc.11 (2020-11-18)
|
||||
|
||||
### ✨ Features
|
||||
|
||||
- Added base64 file stream download
|
||||
- Optimize upload components and examples
|
||||
- New editable row example
|
||||
- Add a personal page
|
||||
- New form page
|
||||
- Add details page
|
||||
- Integrate upload components into form by default
|
||||
|
||||
### 🎫 Chores
|
||||
|
||||
- Update antdv to `2.0.0-rc.1` (temporarily restore to beta15, rc1 menu freezes too seriously.)
|
||||
- Add some notes
|
||||
|
||||
### ✨ Refactor
|
||||
|
||||
- Removed `receiveDrawerDataRef` and `transferDrawerData` properties of `useModal` and `useDrawer`
|
||||
- `openModal` and `openDrawer` corresponding to `useModal` and `useDrawer` extend the third parameter. Used to open the trigger callback again
|
||||
|
||||
### 🐛 Bug Fixes
|
||||
|
||||
- Repair form inputNumber verification error
|
||||
- Fix the error of setting the default value of the form
|
||||
- Fix the problem of occupying position when the menu collapse button is hidden
|
||||
- Fix the form baseColProps does not take effect
|
||||
|
||||
## 2.0.0-rc.10 (2020-11-13)
|
||||
|
||||
### ✨ Refactor
|
||||
|
@ -1,4 +1,4 @@
|
||||
## Wip
|
||||
## 2.0.0-rc.11 (2020-11-18)
|
||||
|
||||
### ✨ Features
|
||||
|
||||
@ -15,6 +15,11 @@
|
||||
- 更新 antdv 到`2.0.0-rc.1`(暂时还原到 beta15,rc1 菜单卡顿太严重.)
|
||||
- 添加部分注释
|
||||
|
||||
### ✨ Refactor
|
||||
|
||||
- 移除`useModal`与`useDrawer`的`receiveDrawerDataRef`和`transferDrawerData`属性
|
||||
- `useModal`与`useDrawer`对应的`openModal`与`openDrawer`扩展第三个参数。用于再次打开触发回调
|
||||
|
||||
### 🐛 Bug Fixes
|
||||
|
||||
- 修复表单 inputNumber 校验错误
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "vben-admin-2.0",
|
||||
"version": "2.0.0-rc.10",
|
||||
"version": "2.0.0-rc.11",
|
||||
"scripts": {
|
||||
"bootstrap": "yarn install",
|
||||
"serve": "esno ./build/script/preserve.ts && cross-env NODE_ENV=development vite",
|
||||
|
@ -7,8 +7,7 @@ export interface DrawerInstance {
|
||||
}
|
||||
|
||||
export interface ReturnMethods extends DrawerInstance {
|
||||
openDrawer: <T = any>(visible?: boolean, data?: T) => void;
|
||||
transferDrawerData: (data: any) => void;
|
||||
openDrawer: <T = any>(visible?: boolean, data?: T, openOnSet?: boolean) => void;
|
||||
}
|
||||
|
||||
export type RegisterFn = (drawerInstance: DrawerInstance, uuid?: string) => void;
|
||||
@ -17,7 +16,6 @@ export interface ReturnInnerMethods extends DrawerInstance {
|
||||
closeDrawer: () => void;
|
||||
changeLoading: (loading: boolean) => void;
|
||||
changeOkLoading: (loading: boolean) => void;
|
||||
receiveDrawerDataRef: any;
|
||||
}
|
||||
|
||||
export type UseDrawerReturnType = [RegisterFn, ReturnMethods];
|
||||
|
@ -6,16 +6,7 @@ import type {
|
||||
UseDrawerInnerReturnType,
|
||||
} from './types';
|
||||
|
||||
import {
|
||||
ref,
|
||||
getCurrentInstance,
|
||||
onUnmounted,
|
||||
unref,
|
||||
reactive,
|
||||
computed,
|
||||
watchEffect,
|
||||
nextTick,
|
||||
} from 'vue';
|
||||
import { ref, getCurrentInstance, onUnmounted, unref, reactive, watchEffect, nextTick } from 'vue';
|
||||
|
||||
import { isProdMode } from '/@/utils/env';
|
||||
import { isFunction } from '/@/utils/is';
|
||||
@ -60,17 +51,18 @@ export function useDrawer(): UseDrawerReturnType {
|
||||
getInstance().setDrawerProps(props);
|
||||
},
|
||||
|
||||
openDrawer: <T = any>(visible = true, data?: T): void => {
|
||||
openDrawer: <T = any>(visible = true, data?: T, openOnSet = false): void => {
|
||||
getInstance().setDrawerProps({
|
||||
visible: visible,
|
||||
});
|
||||
if (data) {
|
||||
dataTransferRef[unref(uidRef)] = data;
|
||||
dataTransferRef[unref(uidRef)] = openOnSet
|
||||
? {
|
||||
...data,
|
||||
__t__: Date.now(),
|
||||
}
|
||||
: data;
|
||||
}
|
||||
},
|
||||
|
||||
transferDrawerData(val: any) {
|
||||
dataTransferRef[unref(uidRef)] = val;
|
||||
},
|
||||
};
|
||||
|
||||
@ -111,10 +103,6 @@ export const useDrawerInner = (callbackFn?: Fn): UseDrawerInnerReturnType => {
|
||||
return [
|
||||
register,
|
||||
{
|
||||
receiveDrawerDataRef: computed(() => {
|
||||
return dataTransferRef[unref(uidRef)];
|
||||
}),
|
||||
|
||||
changeLoading: (loading = true) => {
|
||||
getInstance().setDrawerProps({ loading });
|
||||
},
|
||||
|
@ -9,8 +9,7 @@ export interface ModalMethods {
|
||||
|
||||
export type RegisterFn = (modalMethods: ModalMethods, uuid?: string) => void;
|
||||
export interface ReturnMethods extends ModalMethods {
|
||||
openModal: <T = any>(props?: boolean, data?: T) => void;
|
||||
transferModalData: (data: any) => void;
|
||||
openModal: <T = any>(props?: boolean, data?: T, openOnSet?: boolean) => void;
|
||||
}
|
||||
export type UseModalReturnType = [RegisterFn, ReturnMethods];
|
||||
|
||||
@ -18,7 +17,6 @@ export interface ReturnInnerMethods extends ModalMethods {
|
||||
closeModal: () => void;
|
||||
changeLoading: (loading: boolean) => void;
|
||||
changeOkLoading: (loading: boolean) => void;
|
||||
receiveModalDataRef: any;
|
||||
}
|
||||
export type UseModalInnerReturnType = [RegisterFn, ReturnInnerMethods];
|
||||
|
||||
|
@ -5,16 +5,7 @@ import type {
|
||||
ReturnMethods,
|
||||
UseModalInnerReturnType,
|
||||
} from './types';
|
||||
import {
|
||||
ref,
|
||||
onUnmounted,
|
||||
unref,
|
||||
getCurrentInstance,
|
||||
reactive,
|
||||
computed,
|
||||
watchEffect,
|
||||
nextTick,
|
||||
} from 'vue';
|
||||
import { ref, onUnmounted, unref, getCurrentInstance, reactive, watchEffect, nextTick } from 'vue';
|
||||
import { isProdMode } from '/@/utils/env';
|
||||
import { isFunction } from '/@/utils/is';
|
||||
const dataTransferRef = reactive<any>({});
|
||||
@ -55,17 +46,18 @@ export function useModal(): UseModalReturnType {
|
||||
getInstance().setModalProps(props);
|
||||
},
|
||||
|
||||
openModal: <T = any>(visible = true, data?: T): void => {
|
||||
openModal: <T = any>(visible = true, data?: T, openOnSet = false): void => {
|
||||
getInstance().setModalProps({
|
||||
visible: visible,
|
||||
});
|
||||
if (data) {
|
||||
dataTransferRef[unref(uidRef)] = data;
|
||||
dataTransferRef[unref(uidRef)] = openOnSet
|
||||
? {
|
||||
...data,
|
||||
__t__: Date.now(),
|
||||
}
|
||||
: data;
|
||||
}
|
||||
},
|
||||
|
||||
transferModalData(val: any) {
|
||||
dataTransferRef[unref(uidRef)] = val;
|
||||
},
|
||||
};
|
||||
return [register, methods];
|
||||
@ -106,10 +98,6 @@ export const useModalInner = (callbackFn?: Fn): UseModalInnerReturnType => {
|
||||
return [
|
||||
register,
|
||||
{
|
||||
receiveModalDataRef: computed(() => {
|
||||
return dataTransferRef[unref(uidRef)];
|
||||
}),
|
||||
|
||||
changeLoading: (loading = true) => {
|
||||
getInstance().setModalProps({ loading });
|
||||
},
|
||||
|
@ -1,7 +1,6 @@
|
||||
<template>
|
||||
<BasicDrawer v-bind="$attrs" @register="register" title="Drawer Title" width="50%">
|
||||
<div>
|
||||
<p class="h-20">外部传递数据: {{ receiveDrawerDataRef }}</p>
|
||||
<BasicForm @register="registerForm" />
|
||||
</div>
|
||||
</BasicDrawer>
|
||||
@ -41,14 +40,14 @@
|
||||
span: 24,
|
||||
},
|
||||
});
|
||||
const [register, { receiveDrawerDataRef }] = useDrawerInner((data) => {
|
||||
const [register] = useDrawerInner((data) => {
|
||||
// 方式1
|
||||
setFieldsValue({
|
||||
field2: data.data,
|
||||
field1: data.info,
|
||||
});
|
||||
});
|
||||
return { register, receiveDrawerDataRef, schemas, registerForm };
|
||||
return { register, schemas, registerForm };
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<BasicModal v-bind="$attrs" @register="register" title="Modal Title">
|
||||
<p class="h-20">外部传递数据: {{ receiveModalDataRef }}</p>
|
||||
<BasicForm @register="registerForm" :model="model" />
|
||||
</BasicModal>
|
||||
</template>
|
||||
@ -46,7 +45,7 @@
|
||||
},
|
||||
});
|
||||
|
||||
const [register, { receiveModalDataRef }] = useModalInner((data) => {
|
||||
const [register] = useModalInner((data) => {
|
||||
// 方式1
|
||||
// setFieldsValue({
|
||||
// field2: data.data,
|
||||
@ -60,7 +59,7 @@
|
||||
// model:{ field2: data.data, field1: data.info }
|
||||
// })
|
||||
});
|
||||
return { register, receiveModalDataRef, schemas, registerForm, model: modelRef };
|
||||
return { register, schemas, registerForm, model: modelRef };
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
@ -40,24 +40,8 @@
|
||||
const [register1, { openModal: openModal1, setModalProps }] = useModal();
|
||||
const [register2, { openModal: openModal2 }] = useModal();
|
||||
const [register3, { openModal: openModal3 }] = useModal();
|
||||
const [
|
||||
register4,
|
||||
{
|
||||
openModal: openModal4,
|
||||
// transferModalData
|
||||
},
|
||||
] = useModal();
|
||||
const [register4, { openModal: openModal4 }] = useModal();
|
||||
function send() {
|
||||
// transferModalData({
|
||||
// data: 'content',
|
||||
// info: 'Info',
|
||||
// });
|
||||
// setTimeout(() => {
|
||||
// transferModalData({
|
||||
// data: 'content1',
|
||||
// info: 'Info1',
|
||||
// });
|
||||
// }, 3000);
|
||||
openModal4(true, {
|
||||
data: 'content',
|
||||
info: 'Info',
|
||||
|
Loading…
Reference in New Issue
Block a user