How to put an onclick on window in vuejs?

How do you put a click listener on window in vuejs. So for instance if i click on window, it should set the modal2 = false. I don’t know how would I go about doing it.


---Not sure how to execute an onclick on window to set--
 modal2 = false,
 modal1 = true