近日开发antd vue使用气泡卡片popover浮层时,发现默认在没有设置时,点击时,刚开始的大小是在50%左右,再点击的话会慢慢的变大,等到刷新后再点击还是一样的,不能保证每次点击显示的宽度都是100%,原因是因为大小是由内容区域决定的。我们设置它的宽度为100%。

控制方法:a-popover属性:overlayStyle

代码::overlayStyle="{width:'50%'}"

<a-popover trigger="click" placement="bottom" arrow-point-at-center :overlayStyle="{width:'100%'}">
  <template #content>
<img width="100%" :src="inforUrl" />
  </template>
  <a-button type="link" block>点击查看SIM卡号获取办法</a-button>
</a-popover>