Home > Web Front-end > Vue.js > body text

How vue.js implements pop-up window function

王林
Release: 2021-10-09 16:38:49
Original
3801 people have browsed it

Vue.js method to implement pop-up window function: [document.addEventListener('mouseup',(e)=>{var _con = document.getElementById('children-view')if(_c.. .】.

How vue.js implements pop-up window function

The operating environment of this article: windows10 system, vue.js 2.9, thinkpad t480 computer.

Implementation ideas:

After clicking, click on another location to jump to the route. After the route jumps, use the computed attribute to monitor $route to display and hide the class. The js Contains method is used.

Implementation code:

document.addEventListener('mouseup',(e)=>{
   var _con = document.getElementById('children-view')
   if(_con && !_con.contains(e.target){
       this.$route.push({
           name:"Index"
       })    
   } 
})
Copy after login

How vue.js implements pop-up window function

Recommended learning: php training

The above is the detailed content of How vue.js implements pop-up window function. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template