Antd 的vue模态框modal去除确认或添加按钮(自定义按钮)
1.去除确认按钮<template><a-modal:title="title":width="950":visible="visible":confirmLoading="confirmLoading"@ok="handleOk"@cancel="handleCancel"cancelText="关闭"><template slot="footer"><
·
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>
这里的cancelText="关闭"是控制modal自带的按钮名字。
这个是只留下了关闭按钮,也可以换其他的,只留下确认按钮。
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即可,可以看到这个是三个按钮的。
更多推荐



所有评论(0)