增加关闭按钮:
<DialogFooter>
<DialogClose asChild>
<button className="rounded-sm bg-black/100 px-3 py-2 text-xs font-semibold text-white shadow-xs hover:bg-black/90" >Close</button>
</DialogClose>
</DialogFooter>
隐藏右上角关闭图标:
<DialogContent className="[&>button]:hidden">
点击遮罩不允许关闭dialog:
<DialogContent onInteractOutside={(e) => e.preventDefault()}>
参考:
shadcnui - how to hide the X at the top of the shadcn dialog box? - Stack Overflow