Ant Design Vue模态框modal去除确认或添加按钮

1.去除确认按钮

<template>
  <a-modal
    :title="title"
    :width="950"
    :visible="visible"
    :confirmLoading="confirmLoading"
    @ok="handleOk"
    @cancel="handleCancel"
    cancelText="关闭">
	
    <template slot="footer">
      <a-button @click="handleCancel">关闭</a-button>
    </template>
	
  </a-modal>
</template>

 这个是只留下了关闭按钮,也可以换其他的,只留下确认按钮。

2.增加其他按钮

<template slot="footer">
  <a-button @click="handleCancel">取消</a-button>
  <a-button type="primary" @click="handleReject">驳回</a-button>
  <a-button type="primary" @click="handleOk">确定</a-button>
</template>

更换模态框内的template即可。

可以看到这个是三个按钮的。

2022年 4月12日  改正   必看

上述是一个例子,新版本内例子形式应该是没有变化。但是  slot 属性已被2.x版本弃用。  

因之前开发版本较早,也未深究版本号

根据 @T+  和 @ 我不会不会不会不会 发现2022年4月此时的 <template slot="footer">   已被修改为 

<template #footer>

所以大家在开发时及时替换掉,之前的留下也是为了留个记录!

因最近版本我个人目前未使用,如果发现什么问题,欢迎大家留言,我会改正的!!!

再次谢谢两位朋友发现的问题。

  • 22
    点赞
  • 50
    收藏
    觉得还不错? 一键收藏
  • 8
    评论
评论 8
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值