AntdVue的Modal组件底部按钮显隐

60 阅读1分钟

背景

符合条件时,按钮显示,不符合条件,按钮隐藏

image.png

解决办法

根据Modal的API(footer),传入null隐藏按钮,传入undefined显示按钮(传false,''都不行,只能是undefined)


    <Modal
        :title="title"
        :visible="visible"
        centered
        :footer="isShowFooter ? undefined : null"
        @ok="onModeSure"
        @cancel="onModelCancel"
    >
    </Modal>