Click on a box to display the style in vue. Now you want to click on the space outside the box and let the style be hidden. What event should be added?

Click on a box to display the style in

vue. Now click on the space outside the box and let the style be hidden. What event should be added?

Mar.19,2021

idea:
add a click event to the document, let the style hide when you click on the document;
add a click event to the box, let the style display when you click on the box, and prevent the event from bubbling, so that the click event of the document will not be executed.

Code:

document.addEventListener('click', function (e) {
  // 
}, false)
// @click.stop@click.stop

get the location of the mouse click, determine the location of the mouse click, whether it is in the box area, display the style in the box area, and hide it if it is not in the box area


reference link: https://blog.csdn.net/qq_4020.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3bf15-2bb28.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3bf15-2bb28.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?