*洋芋果果 2022-02-18 15:52 采纳率: 50%
浏览 333
已结题

ant-design-vue的弹框样式无法修改

我尝试过三种方法,都无法修改
1.在modal外面主动套一个div


```html
<template>
  <a-config-provider :locale="zhCN">
    <div ref="refModel" class="orgContainer">
      <a-modal
        :getContainer="() => $refs.refModel"
        width="760px"
        title="【xxx】机构数据明细"
        :visible="visible"
        @cancel="handleCancel"
      >
        <p>{{ "内容区域" }}</p>
      </a-modal>
    </div>
  </a-config-provider>
</template>



```html
<style scoped>
.refModel .a-modal {
  height: 474px !important;
  height: 760px;
  background: yellow;
}
</style>


2.wrapClassName官网提供的对话框外层容器的类名也无效


```html
 <a-modal
        width="760px"
        title="【xxx】机构数据明细"
        :visible="visible"
        @cancel="handleCancel"
        wrapClassName="orgContainer"
      >
        <p>{{ "内容区域" }}</p>
      </a-modal>

.orgContainer .a-modal {
  height: 474px !important;
  height: 760px;
  background: yellow;
}

```

  • 写回答

1条回答 默认 最新

  • *洋芋果果 2022-02-18 16:37
    关注

    吐血,原来是有用的,只是我把弹框单独写成了个组件,自己挂在自己身上怎么会有效呢,方法一是有用的

    评论

报告相同问题?

问题事件

  • 系统已结题 2月26日
  • 创建了问题 2月18日