Pārlūkot izejas kodu

style(Drawer): antdv4版本 drawer要使用rootClassName来来配置最外层元素样式 (#3012)

invalid w 1 gadu atpakaļ
vecāks
revīzija
356f132610

+ 2 - 2
src/components/Drawer/src/BasicDrawer.vue

@@ -1,5 +1,5 @@
 <template>
-  <Drawer :class="prefixCls" @close="onClose" v-bind="getBindValues">
+  <Drawer :rootClassName="prefixCls" @close="onClose" v-bind="getBindValues">
     <template #title v-if="!$slots.title">
       <DrawerHeader
         :title="getMergeProps.title"
@@ -94,7 +94,7 @@
             opt.width = '100%';
           }
           const detailCls = `${prefixCls}__detail`;
-          opt.class = wrapClassName ? `${wrapClassName} ${detailCls}` : detailCls;
+          opt.rootClassName = wrapClassName ? `${wrapClassName} ${detailCls}` : detailCls;
 
           if (!getContainer) {
             // TODO type error?

+ 1 - 0
src/components/Drawer/src/typing.ts

@@ -134,6 +134,7 @@ export interface DrawerProps extends DrawerFooterProps {
    */
   wrapClassName?: string;
   class?: string;
+  rootClassName?: string;
   /**
    * Style of wrapper element which **contains mask** compare to `drawerStyle`
    * @type object