Get the App
SLTechnology News&Howtos  ›  Development  › 

How to realize the function of pop-up window in vue.js

Shulou Source: shulou.com Published: 2022-06-03 07:21:46 11月15日 Update

This article will explain in detail how to achieve the pop-up window function of vue.js. The content of the article is of high quality, so the editor will share it for you as a reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.

The method of realizing pop-up window by vue.js: [document.addEventListener ('mouseup', (e) = > {var _ con = document.getElementById (' children-view') if (_ c...]).

The operating environment of this paper: windows10 system, vue.js 2.9, thinkpad T480 computer.

The idea of realization is:

After clicking, click on another location to jump the route, and after the route is redirected, use the computed attribute to monitor $route to show and hide the class, using the js Contains method.

Implementation code:

Document.addEventListener ('mouseup', (e) = > {var _ con = document.getElementById (' children-view') if (_ con & &! _ con.contains (e.target) {this.$route.push ({name: "Index")}) about how to achieve pop-up window function is shared here. I hope the above content can be helpful to you and learn more knowledge. If you think the article is good, you can share it for more people to see.

Tags: Function content article method more knowledge article routing good code location attributes ideas environment computer system quality reference help related Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology Microsoft Apple Docker Huawei