Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
220 views
in Technique[技术] by (71.8m points)

javascript - How to disable closing a modal when clicking the x button on an ant modal in vue

Basically, I'm trying to add a confirmation before closing an ant modal in Vue to make sure user wants to discard the changes made. so, the idea is to disable the default behavior of closing the modal and trigger in only in certain scenarios.

I tried the following:

on the a-modal tag: @cancel="handleCancel"

and in the methods: handleCancel(e) { e.stopPropagation(); e.preventDefault(); } but didn't seem to work

question from:https://stackoverflow.com/questions/65886683/how-to-disable-closing-a-modal-when-clicking-the-x-button-on-an-ant-modal-in-vue

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...