How is the state of the Dom element passed?

question: how can other event listeners or functions get this Dom state after an event listener method changes the Dom state (such as hiding)?

usage scenarios: jquery, vue

Jul.07,2021

what do you want to say? dom status, just go to dom and look it up


this is actually a matter of passing parameters by a function call, and the parameter is your state

You can do this in

vue, refer to

 

study Object.defineProperty . This api has been understood, but has not been studied in depth. Many MV frameworks (including vue ) are based on this api . Landlords can try

.
defines a new property directly on an object (including the dom object) through the Object.defineProperty method, or modifies an existing property. Eventually this method returns the object.
Menu