Skip to content

Commit af62058

Browse files
committed
feat: dialogStyle dialogClass deprecated #3142
1 parent d122901 commit af62058

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

components/vc-dialog/Dialog.jsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import BaseMixin from '../_util/BaseMixin';
77
import { getTransitionProps, Transition } from '../_util/transition';
88
import switchScrollingEffect from '../_util/switchScrollingEffect';
99
import getDialogPropTypes from './IDialogPropTypes';
10+
import warning from '../_util/warning';
1011
const IDialogPropTypes = getDialogPropTypes();
1112

1213
let uuid = 0;
@@ -64,6 +65,8 @@ export default defineComponent({
6465
focusTriggerAfterClose: true,
6566
}),
6667
data() {
68+
warning(!this.dialogClass, 'Modal', 'dialogClass is deprecated, please use class instead.');
69+
warning(!this.dialogStyle, 'Modal', 'dialogStyle is deprecated, please use style instead.');
6770
return {
6871
inTransition: false,
6972
titleId: `rcDialogTitle${uuid++}`,
@@ -210,8 +213,8 @@ export default defineComponent({
210213
bodyProps,
211214
forceRender,
212215
closeIcon,
213-
dialogStyle,
214-
dialogClass,
216+
dialogStyle = {},
217+
dialogClass = '',
215218
} = this;
216219
const dest = { ...dialogStyle };
217220
if (width !== undefined) {

components/vc-dialog/IDialogPropTypes.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ function IDialogPropTypes() {
3232
maskProps: PropTypes.any,
3333
wrapProps: PropTypes.any,
3434
getContainer: PropTypes.any,
35-
dialogStyle: PropTypes.object.def(() => ({})),
36-
dialogClass: PropTypes.string.def(''),
35+
dialogStyle: PropTypes.object,
36+
dialogClass: PropTypes.string,
3737
closeIcon: PropTypes.any,
3838
forceRender: PropTypes.looseBool,
3939
getOpenCount: PropTypes.func,

0 commit comments

Comments
 (0)