diff --git a/components/drawer/index.jsx b/components/drawer/index.jsx
index 9a6054d12..dd6f83b9b 100644
--- a/components/drawer/index.jsx
+++ b/components/drawer/index.jsx
@@ -1,9 +1,10 @@
import warning from 'warning'
+import classnames from 'classnames'
import VcDrawer from '../vc-drawer/src'
import PropTypes from '../_util/vue-types'
import BaseMixin from '../_util/BaseMixin'
import Icon from '../icon'
-import { getComponentFromProp, getOptionProps, getClass } from '../_util/props-util'
+import { getComponentFromProp, getOptionProps } from '../_util/props-util'
const Drawer = {
name: 'ADrawer',
@@ -22,14 +23,10 @@ const Drawer = {
prefixCls: PropTypes.string.def('ant-drawer'),
placement: PropTypes.oneOf(['top', 'right', 'bottom', 'left']).def('right'),
level: PropTypes.any.def(null),
- wrapClassName: PropTypes.string,
+ wrapClassName: PropTypes.string, // not use class like react, vue will add class to root dom
},
mixins: [BaseMixin],
data () {
- warning(
- this.wrapClassName === undefined,
- 'wrapClassName is deprecated, please use className instead.',
- )
this.destoryClose = false
this.preVisible = this.$props.visible
return {
@@ -199,17 +196,16 @@ const Drawer = {
open: visible,
showMask: props.mask,
placement,
+ className: classnames({
+ [wrapClassName]: !!wrapClassName,
+ [haveMask]: !!haveMask,
+ }),
},
on: {
maskClick: this.onMaskClick,
...this.$listeners,
},
style: this.getRcDrawerStyle(),
- class: {
- [wrapClassName]: !!wrapClassName,
- ...getClass(this),
- [haveMask]: !!haveMask,
- },
}
return (