Button click self-locking control method, device and equipment and readable storage medium

By defining waiting click instructions and closure functions in the vue framework, the button is automatically locked, which solves the problem of asynchronous interface request caused by repeated clicks of buttons in front-end development, avoids the risks of business code adjustment and developer mode unlocking, and improves the risk of System stability and security.

CN119148904APending Publication Date: 2024-12-17CHINA ELECTRONICS CLOUD DIGITAL INTELLIGENCE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411385068.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2024-12-17

AI Technical Summary

Technical Problem

In front-end development, the asynchronous interface request problem caused by repeated clicks on buttons. The existing technology requires adjustment of business code or the risk of unlocking is not effectively avoided.

Method used

By defining waiting click instructions in the vue framework, listening to button click events, binding asynchronous methods using closure functions and scope variables, and waiting for their execution through the wait keyword to complete, the button will be automatically locked and avoiding business code adjustments and Unlocked in developer mode.

Benefits of technology

It realizes automatic self-locking of button clicks, prevents repeated clicks, avoids the risks of business code adjustment and developer mode unlocking, and improves system stability and security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119148904A_ABST
    Figure CN119148904A_ABST
Patent Text Reader

Abstract

A button click self-locking control method, apparatus and device, and a readable storage medium relate to the technical field of computers, and comprise: when a target click event corresponding to a target button is monitored, calling a target event processing function through a target click waiting instruction corresponding to the target button, the target event processing function comprises a target closure function and a target action range variable, and the target waiting click instruction is constructed based on a vue framework; and binding the target closure function to a target document object model (DOM) corresponding to the target button through the target event processing function, so as to assign a target asynchronous method corresponding to the target click event to a target action range variable based on the target closure function, so as to execute the target asynchronous method and wait through a wait keyword, therefore, a new click event of the target button is intercepted, click self-locking of the target button is achieved, meanwhile, a service code does not need to be adjusted, and the button cannot be unlocked in a developer mode.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a button click self-locking control method, device, equipment and readable storage medium. Background Art

[0002] In daily front-end development, it is very common to trigger an event by clicking a button to request a back-end interface. However, since the interface request is often an asynchronous code, the time from when the request is sent to when the response data is received is unknown. As a result, the network cannot prohibit any user operation during the period from when the request is sent to when the response data is received, allowing the user to repeatedly click the button to send the request. When the request is sent multiple times due to repeated clicks of the button by the user, if the server handles it improperly, it will cause data operation errors and interface errors.

[0003] In the related art, in order to prevent the above problems from occurring, the following measures are usually taken: (1) the client directly performs throttling and anti-shaking processing on the business code; (2) during the period from when the client sends an interface request to when it receives the response data from the server, a button style state such as loading or disabling is added to the button. Although the above methods can effectively solve the problem caused by repeated button clicks, method (1) generally uses custom throttling and anti-shaking code or existing tools to self-lock the function, so that the business code needs to be adjusted, and relevant code needs to be added at each location where the self-locking button needs to be clicked, which is relatively redundant; while method (2) needs to add business code to change the button style, that is, it also adjusts the business code and relevant code needs to be added at each location where the self-locking button needs to be clicked. In addition, there is a risk that the client can modify the button style through the developer mode to unlock the button.

[0004] It can be seen that how to achieve self-locking when clicking a button while avoiding adjusting the business code and preventing the button from being unlocked through the developer mode is an urgent problem that needs to be solved. Summary of the invention

[0005] The present application provides a button click self-locking control method, device, equipment and readable storage medium, which can effectively realize automatic self-locking of a button click without adjusting the business code and the button cannot be unlocked through the developer mode.

[0006] In a first aspect, an embodiment of the present application provides a button click self-locking control method, the button click self-locking control method comprising:

[0007] When a target click event corresponding to a target button is monitored, a target event processing function is called through a target wait click instruction corresponding to the target button, wherein the target event processing function includes a target closure function and a target scope variable, and the target wait click instruction is constructed based on a vue framework;

[0008] The target closure function is bound to the target document object model DOM corresponding to the target button through the target event processing function, so that the target asynchronous method corresponding to the target click event is assigned to the target scope variable based on the target closure function, so as to execute the target asynchronous method and wait through the wait keyword to intercept the new click event of the target button and realize the self-locking of the click of the target button.

[0009] In combination with the first aspect, in one implementation, in the process of calling the target event processing function through the target waiting click instruction corresponding to the target button, it also includes:

[0010] The target parameter corresponding to the target button is sent to the target event processing function through the target wait click instruction, so that the target event processing function can perform function binding based on the target parameter. The target parameter includes a first parameter, a second parameter and a third parameter. The first parameter is used to characterize whether an event binding or unbinding operation is required, the second parameter is used to characterize the DOM object to be bound, and the third parameter is used to characterize the asynchronous method to be bound.

[0011] In combination with the first aspect, in one implementation, binding the target closure function to a target document object model DOM corresponding to the target button through the target event processing function includes:

[0012] When the target event processing function detects that the value corresponding to the first parameter is a first preset value, the target closure function is bound to the target DOM corresponding to the target button based on the second parameter, and the first preset value is used to indicate that a binding operation needs to be performed on the event.

[0013] In combination with the first aspect, in one implementation, assigning the target asynchronous method corresponding to the target click event to the target scope variable based on the target closure function includes:

[0014] Acquire a target asynchronous method corresponding to a target click event based on the target closure function and through the third parameter;

[0015] The target asynchronous method corresponding to the target click event is assigned to the target scope variable through the target closure function.

[0016] In combination with the first aspect, in one implementation, before the step of assigning the target asynchronous method corresponding to the target click event to the target scope variable based on the target closure function, the step further includes:

[0017] Determine whether the target scope variable has been defined through the target closure function;

[0018] If the target scope variable is not defined, then executing the step of assigning the target asynchronous method corresponding to the target click event to the target scope variable based on the target closure function;

[0019] If the target scope variable has been defined, wait for the asynchronous method corresponding to the target scope variable to be executed.

[0020] In a second aspect, an embodiment of the present application provides a button-click self-locking control device, the button-click self-locking control device comprising:

[0021] The first control module is used to call a target event processing function through a target wait click instruction corresponding to the target button when a target click event corresponding to the target button is monitored, wherein the target event processing function includes a target closure function and a target scope variable, and the target wait click instruction is constructed based on a vue framework;

[0022] The second control module is used to bind the target closure function to the target document object model DOM corresponding to the target button through the target event processing function, so as to assign the target asynchronous method corresponding to the target click event to the target scope variable based on the target closure function, so as to execute the target asynchronous method and wait through the wait keyword to intercept the new click event of the target button and realize the click self-locking of the target button.

[0023] In conjunction with the second aspect, in one implementation, the first control module is further configured to:

[0024] The target parameter corresponding to the target button is sent to the target event processing function through the target wait click instruction, so that the target event processing function can perform function binding based on the target parameter. The target parameter includes a first parameter, a second parameter and a third parameter. The first parameter is used to characterize whether an event binding or unbinding operation is required, the second parameter is used to characterize the DOM object to be bound, and the third parameter is used to characterize the asynchronous method to be bound.

[0025] In conjunction with the second aspect, in one implementation, the second control module is specifically configured to:

[0026] When the target event processing function detects that the value corresponding to the first parameter is a first preset value, the target closure function is bound to the target DOM corresponding to the target button based on the second parameter, and the first preset value is used to indicate that a binding operation needs to be performed on the event.

[0027] In conjunction with the second aspect, in one implementation, the second control module is further configured to:

[0028] Acquire a target asynchronous method corresponding to a target click event based on the target closure function and through the third parameter;

[0029] The target asynchronous method corresponding to the target click event is assigned to the target scope variable through the target closure function.

[0030] In conjunction with the second aspect, in one implementation, the second control module is further configured to:

[0031] Determine whether the target scope variable has been defined through the target closure function;

[0032] If the target scope variable is not defined, then executing the step of assigning the target asynchronous method corresponding to the target click event to the target scope variable based on the target closure function;

[0033] If the target scope variable has been defined, wait for the asynchronous method corresponding to the target scope variable to be executed.

[0034] In the third aspect, an embodiment of the present application provides a button-click self-locking control device, which includes a processor, a memory, and a button-click self-locking control program stored in the memory and executable by the processor, wherein when the button-click self-locking control program is executed by the processor, the steps of the button-click self-locking control method as described above are implemented.

[0035] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a button-click self-locking control program is stored, wherein when the button-click self-locking control program is executed by a processor, the steps of the button-click self-locking control method as described above are implemented.

[0036] The beneficial effects brought by the technical solution provided by the embodiments of the present application include:

[0037] When the target click event corresponding to the target button is monitored, the target event handling function is called through the target wait click instruction built based on the vue framework, so that the target closure function therein is bound to the target DOM corresponding to the target button through the target event handling function, and then the target asynchronous method corresponding to the target click event is assigned to the target scope variable of the target event handling function through the target closure function, so as to execute the target asynchronous method and wait for the target asynchronous method to be executed through the wait keyword, and then the button event triggering behavior can be intercepted, that is, before the target asynchronous method is executed, the target button automatically locks itself to prohibit new click events from being transmitted, thereby realizing click self-locking from within the button, without adjusting any other business code, and also making it impossible for users to unlock the button by modifying the style in developer mode. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 This is a flow chart of an embodiment of a button-click self-locking control method of this application;

[0039] Figure 2 For this application Figure 1 Detailed flow chart of step S20;

[0040] Figure 3 This is a schematic diagram of the hardware structure of the button-click self-locking control device involved in the embodiment of the present application. DETAILED DESCRIPTION

[0041] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0042] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below in conjunction with the accompanying drawings.

[0043] In a first aspect, an embodiment of the present application provides a button-click self-locking control method.

[0044] In one embodiment, referring to Figure 1 , Figure 1 This is a flow chart of an embodiment of the button click self-locking control method of this application. Figure 1 As shown, the button click self-locking control method includes:

[0045] Step S10: When a target click event corresponding to a target button is monitored, a target event processing function is called through a target wait click instruction corresponding to the target button, wherein the target event processing function includes a target closure function and a target scope variable, and the target wait click instruction is constructed based on a vue framework.

[0046] Exemplarily, in this embodiment, the button event triggering behavior is intercepted based on the vue (a JavaScript framework for building user interfaces) instruction (where the vue instruction is a special attribute with a "v-" prefix) to prohibit the event from being transmitted outward, and then the button is automatically locked, thereby avoiding the adjustment of the business code and preventing the button from being unlocked through the developer mode.

[0047] Specifically, this embodiment will pre-customize a wait-click instruction for each button that needs to implement the self-locking function based on the vue framework and register it on the vue project. For example, a custom wait-click instruction named awaitClick is defined based on vue, and the life cycle mounted and beforeUnmount methods of the instruction are defined; it should be understood that mounted is a life cycle hook of the vue component, which is in the DOM (DocumentObject Model, document object model, which represents the HTML tag element node object, HTML is a markup language designed for web page creation and other information that can be viewed in a web browser) is mounted (i.e., inserted into the document flow) and is called immediately. The mounted method in this embodiment includes an el parameter (the el parameter refers to the DOM of the button, i.e., it points to a button element on the page, i.e., the element to which the event will be bound) and a binding parameter (the binding parameter includes binding parameters such as the asynchronous method corresponding to the click event to be bound); beforeUnmount is also a lifecycle hook in the vue component, which is called before the destruction process of the component begins, i.e., this hook allows cleanup operations to be performed before the component instance is destroyed, such as removing event listeners, timers, or cleaning up DOM elements; it should be noted that beforeUnmount only contains the el parameter, i.e., the element to which the event will be unbound is determined by the el parameter.

[0048] In addition, this embodiment will also define an event processing function setEvent, and call the event processing function setEvent by waiting for the click instruction awaitClick to realize the self-locking function of the button click. It should be noted that the event processing function setEvent includes 3 parameters: isBind parameter, el parameter and binding parameter; among which, the isBind parameter is used to determine the binding and unbinding of the event, the el parameter is the DOM of the button, and the binding parameter is the binding parameter of the waiting click instruction; in the setEvent function, an asynchronous closure function clickFn will be created, and the clickFn function can obtain the asynchronous method of the waiting click instruction through the binding.value attribute (the asynchronous method refers to the interface request corresponding to the click event of the button), and assign it to the scope variable eventFn of the setEvent function to execute the asynchronous method through the eventFn function; it should be understood that when clickFn is running, the await keyword will be used to wait for eventFn to run, and this function can be realized through the code statement "await eventFn()", and after its execution, eventFn is cleared through eventFn=null to realize the automatic self-locking of the button click. The "try...finally" code structure can be used to ensure that regardless of whether the code statement "await eventFn()" is successfully executed, eventFn will eventually be set to null to avoid accidentally calling eventFn again outside the function.

[0049] Therefore, when the user clicks on a target button (that is, the target button is mounted on the corresponding target DOM), the target wait-click instruction awaitClick corresponding to the target button will monitor the target click event. At this time, the target wait-click instruction awaitClick will call the target event processing function setEvent to realize the self-locking of the target button's click through the target event processing function setEvent.

[0050] Furthermore, in one embodiment, in the process of calling the target event processing function through the target waiting click instruction corresponding to the target button, it also includes:

[0051] The target parameter corresponding to the target button is sent to the target event processing function through the target wait click instruction, so that the target event processing function can perform function binding based on the target parameter. The target parameter includes a first parameter, a second parameter and a third parameter. The first parameter is used to characterize whether an event binding or unbinding operation is required, the second parameter is used to characterize the DOM object to be bound, and the third parameter is used to characterize the asynchronous method to be bound.

[0052] Exemplarily, in this embodiment, in the process of the target waiting click instruction awaitClick calling the target event processing function setEvent, the target parameters including the target isBind parameter (i.e., the first parameter) used to characterize whether it is necessary to bind or unbind the target button, the target el parameter (i.e., the second parameter) used to characterize the DOM object to be bound as the target DOM of the target button, and the target binding parameter (i.e., the third parameter) used to characterize the asynchronous method to be bound as the target asynchronous method corresponding to the target click event of the target button will also be passed to the target event processing function setEvent, so that the target event processing function setEvent can determine whether it is necessary to perform event binding on the target DOM in the target el parameter according to the target isBind parameter, and then control the self-locking of the target button based on the target binding parameter.

[0053] Step S20: Bind the target closure function to the target document object model DOM corresponding to the target button through the target event processing function, so as to assign the target asynchronous method corresponding to the target click event to the target scope variable based on the target closure function, so as to execute the target asynchronous method and wait through the wait keyword to intercept the new click event of the target button and realize the self-locking of the click of the target button.

[0054] Exemplarily, in this embodiment, in order to achieve self-locking of the click of the target button, the target event processing function setEvent will bind its internal target closure function clickFn to the target DOM corresponding to the target button and run the target closure function clickFn, so that the target closure function clickFn can obtain the target binding parameter passed in by the target wait click instruction awaitClick; and the target closure function clickFn will assign the target asynchronous method in the target binding parameter to the target scope variable eventFn of the target event processing function setEvent, and run the new eventFn in the target closure function clickFn, that is, run the target asynchronous method in the target closure function clickFn; in addition, the target closure function clickFn also limits the operation of eventFn through the wait keyword to intercept new click events of the target button, that is, when the target closure function clickFn is running, it must wait for the target asynchronous method to be executed before receiving new click events, and after its execution is completed, eventFn can be cleared through eventFn=null. It can be seen that before the target asynchronous method is executed, this embodiment realizes automatic self-locking of the target button to prohibit new click events from being transmitted, thereby realizing click self-locking from within the button without adjusting any other business code, and also making it impossible for users to unlock the button by modifying the style through the developer mode.

[0055] In summary, this embodiment can intercept the button event triggering behavior by registering the wait-for-click instruction awaitClick in the vue project, and using the awaitClick code on the button (for example, v-awaitClick="myClickFn", where myClickFn is a custom asynchronous method for sending a request for a button click), so that the button automatically locks itself before the myClickFn asynchronous method is executed, and new events are prohibited from being transmitted, thereby realizing click self-locking from within the button. There is no need to adjust any other business code, nor will it cause code redundancy, and the button cannot be unlocked by modifying the style in developer mode.

[0056] Further, in one embodiment, the binding of the target closure function to the target document object model DOM corresponding to the target button through the target event processing function includes:

[0057] When the target event processing function detects that the value corresponding to the first parameter is a first preset value, the target closure function is bound to the target DOM corresponding to the target button based on the second parameter, and the first preset value is used to indicate that a binding operation needs to be performed on the event.

[0058] Exemplarily, in this embodiment, the value of the target isBind parameter can be used to indicate whether the target button needs to be bound or unbound; for example, if the value of the target isBind parameter is "true" (i.e., the first preset value), it indicates that the target button needs to be bound to the event, while if the value of the target isBind parameter is "false", it indicates that the target button needs to be unbound to the event. Therefore, when the target event processing function setEvent detects that the value of the isBind parameter is "true", the target closure function will be bound to the target DOM of the target button based on the target el parameter; and if the target event processing function setEvent detects that the value of the isBind parameter is "false", the target closure function will be unbound from the target DOM of the target button based on the target el parameter.

[0059] Further, see Figure 2 As shown, assigning the target asynchronous method corresponding to the target click event to the target scope variable based on the target closure function includes:

[0060] Step S201: acquiring a target asynchronous method corresponding to a target click event based on the target closure function and through the third parameter;

[0061] Step S202: assigning the target asynchronous method corresponding to the target click event to the target scope variable through the target closure function.

[0062] Exemplarily, in this embodiment, the running target closure function clickFn can obtain the target binding parameter passed in by the target wait-click instruction awaitClick through the binding.value attribute to determine the target asynchronous method corresponding to the target click event of the target button, and then assign the target asynchronous method to the target scope variable eventFn of the target event processing function setEvent, so that the target asynchronous method can be run in the target closure function clickFn.

[0063] Furthermore, in one embodiment, before the step of assigning the target asynchronous method corresponding to the target click event to the target scope variable based on the target closure function, the step further includes:

[0064] Determine whether the target scope variable has been defined through the target closure function;

[0065] If the target scope variable is not defined, then executing the step of assigning the target asynchronous method corresponding to the target click event to the target scope variable based on the target closure function;

[0066] If the target scope variable has been defined, wait for the asynchronous method corresponding to the target scope variable to be executed.

[0067] Exemplarily, in this embodiment, the target scope variable eventFn will be assigned a value only when it is determined that it does not exist (that is, it is not defined); therefore, when the target closure function clickFn obtains the target binding parameter passed in by the target wait-click instruction awaitClick, it first needs to determine whether the target scope variable eventFn has been defined. If the target scope variable eventFn is not defined, it will try to obtain the target asynchronous method from binding.value and assign it to the target scope variable eventFn; if the target scope variable eventFn has been defined, it will not obtain the target asynchronous method from binding.value, that is, the target scope variable eventFn will not be repeatedly assigned a value, but the click event of the target button will be listened to again. In other words, it is necessary to wait for the existing asynchronous method in the target scope variable eventFn to be executed to ensure that the asynchronous method bound last time can run normally.

[0068] In a second aspect, an embodiment of the present application also provides a button-click self-locking control device.

[0069] In one embodiment, the button click self-locking control device includes:

[0070] The first control module is used to call a target event processing function through a target wait click instruction corresponding to the target button when a target click event corresponding to the target button is monitored, wherein the target event processing function includes a target closure function and a target scope variable, and the target wait click instruction is constructed based on a vue framework;

[0071] The second control module is used to bind the target closure function to the target document object model DOM corresponding to the target button through the target event processing function, so as to assign the target asynchronous method corresponding to the target click event to the target scope variable based on the target closure function, so as to execute the target asynchronous method and wait through the wait keyword to intercept the new click event of the target button and realize the click self-locking of the target button.

[0072] Furthermore, in one embodiment, the first control module is further configured to:

[0073] The target parameter corresponding to the target button is sent to the target event processing function through the target wait click instruction, so that the target event processing function can perform function binding based on the target parameter. The target parameter includes a first parameter, a second parameter and a third parameter. The first parameter is used to characterize whether an event binding or unbinding operation is required, the second parameter is used to characterize the DOM object to be bound, and the third parameter is used to characterize the asynchronous method to be bound.

[0074] Furthermore, in one embodiment, the second control module is specifically configured to:

[0075] When the target event processing function detects that the value corresponding to the first parameter is a first preset value, the target closure function is bound to the target DOM corresponding to the target button based on the second parameter, and the first preset value is used to indicate that a binding operation needs to be performed on the event.

[0076] Furthermore, in one embodiment, the second control module is further configured to:

[0077] Acquire a target asynchronous method corresponding to a target click event based on the target closure function and through the third parameter;

[0078] The target asynchronous method corresponding to the target click event is assigned to the target scope variable through the target closure function.

[0079] Furthermore, in one embodiment, the second control module is further configured to:

[0080] Determine whether the target scope variable has been defined through the target closure function;

[0081] If the target scope variable is not defined, then executing the step of assigning the target asynchronous method corresponding to the target click event to the target scope variable based on the target closure function;

[0082] If the target scope variable has been defined, wait for the asynchronous method corresponding to the target scope variable to be executed.

[0083] Among them, the functional implementation of each module in the above-mentioned button-click self-locking control device corresponds to the various steps in the above-mentioned button-click self-locking control method embodiment, and its functions and implementation processes will not be repeated here one by one.

[0084] In a third aspect, an embodiment of the present application provides a button-click self-locking control device, which may be a personal computer (PC), a laptop computer, a server, or other device with data processing capabilities.

[0085] Reference Figure 3 , Figure 3 Schematic diagram of the hardware structure of the button click self-locking control device involved in the embodiment of the present application. In the embodiment of the present application, the button click self-locking control device may include a processor, a memory, a communication interface and a communication bus.

[0086] The communication bus may be of any type and is used to interconnect the processor, the memory, and the communication interface.

[0087] The communication interface includes an input / output (I / O) interface, a physical interface, and a logical interface, which are used to interconnect the components inside the button click self-locking control device, and an interface used to interconnect the button click self-locking control device with other devices (such as other computing devices or user devices). The physical interface can be an Ethernet interface, an optical fiber interface, an ATM interface, etc.; the user device can be a display, a keyboard, etc.

[0088] The memory can be various types of storage media, such as random access memory (RAM), read-only memory (ROM), non-volatile RAM (NVRAM), flash memory, optical storage, hard disk, programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), etc.

[0089] The processor may be a general-purpose processor, and the general-purpose processor may call the button click self-locking control program stored in the memory, and execute the button click self-locking control method provided in the embodiment of the present application. For example, the general-purpose processor may be a central processing unit (CPU). The method executed when the button click self-locking control program is called may refer to the various embodiments of the button click self-locking control method of the present application, which will not be repeated here.

[0090] Those skilled in the art will understand that Figure 3 The hardware structure shown in the figure does not constitute a limitation on the present application, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0091] In a fourth aspect, an embodiment of the present application also provides a computer-readable storage medium.

[0092] A button-click self-locking control program is stored on a readable storage medium of the present application, wherein when the button-click self-locking control program is executed by a processor, the steps of the button-click self-locking control method as described above are implemented.

[0093] Among them, the method implemented when the button click self-locking control program is executed can refer to the various embodiments of the button click self-locking control method of this application, and will not be repeated here.

[0094] It should be noted that the serial numbers of the above-mentioned embodiments of the present application are only for description and do not represent the advantages or disadvantages of the embodiments.

[0095] The terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices. The terms "first", "second" and "third" are used to distinguish different objects, etc., and do not represent a sequence, nor do they limit "first", "second" and "third" to different types.

[0096] In the description of the embodiments of the present application, "exemplary", "for example" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary", "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary", "for example" or "for example" is intended to present related concepts in a specific way.

[0097] In the description of the embodiments of the present application, unless otherwise specified, “ / ” means or, for example, A / B can mean A or B; the “and / or” in the text is merely a description of the association relationship of associated objects, indicating that three relationships may exist, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, “multiple” refers to two or more than two.

[0098] In some processes described in the embodiments of the present application, multiple operations or steps that appear in a specific order are included, but it should be understood that these operations or steps may not be executed in the order in which they appear in the embodiments of the present application or in parallel, and the sequence number of the operation is only used to distinguish the different operations, and the sequence number itself does not represent any execution order. In addition, these processes may include more or fewer operations, and these operations or steps may be executed in sequence or in parallel, and these operations or steps may be combined.

[0099] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, disk, CD) as described above, and includes a number of instructions for a terminal device to execute the methods described in each embodiment of the present application.

[0100] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A button click self-locking control method, characterized in that: The button click self-locking control method comprises: When a target click event corresponding to a target button is monitored, a target event processing function is called through a target wait click instruction corresponding to the target button, wherein the target event processing function includes a target closure function and a target scope variable, and the target wait click instruction is constructed based on a vue framework; The target closure function is bound to the target document object model DOM corresponding to the target button through the target event processing function, so that the target asynchronous method corresponding to the target click event is assigned to the target scope variable based on the target closure function, so as to execute the target asynchronous method and wait through the wait keyword to intercept the new click event of the target button and realize the self-locking of the click of the target button.

2. The button click self-locking control method according to claim 1, characterized in that: In the process of calling the target event processing function through the target waiting click instruction corresponding to the target button, it also includes: The target parameter corresponding to the target button is sent to the target event processing function through the target wait click instruction, so that the target event processing function can perform function binding based on the target parameter. The target parameter includes a first parameter, a second parameter and a third parameter. The first parameter is used to characterize whether an event binding or unbinding operation is required, the second parameter is used to characterize the DOM object to be bound, and the third parameter is used to characterize the asynchronous method to be bound.

3. The button click self-locking control method according to claim 2, characterized in that: The step of binding the target closure function to the target document object model DOM corresponding to the target button through the target event processing function includes: When the target event processing function detects that the value corresponding to the first parameter is a first preset value, the target closure function is bound to the target DOM corresponding to the target button based on the second parameter, and the first preset value is used to indicate that a binding operation needs to be performed on the event.

4. The button click self-locking control method according to claim 2, characterized in that: The assigning the target asynchronous method corresponding to the target click event to the target scope variable based on the target closure function includes: Acquire a target asynchronous method corresponding to a target click event based on the target closure function and through the third parameter; The target asynchronous method corresponding to the target click event is assigned to the target scope variable through the target closure function.

5. The button click self-locking control method according to claim 1, characterized in that: Before the step of assigning the target asynchronous method corresponding to the target click event to the target scope variable based on the target closure function, the method further includes: Determine whether the target scope variable has been defined through the target closure function; If the target scope variable is not defined, then executing the step of assigning the target asynchronous method corresponding to the target click event to the target scope variable based on the target closure function; If the target scope variable has been defined, wait for the asynchronous method corresponding to the target scope variable to be executed.

6. A button click self-locking control device, characterized in that: The button click self-locking control device comprises: The first control module is used to call a target event processing function through a target wait click instruction corresponding to the target button when a target click event corresponding to the target button is monitored, wherein the target event processing function includes a target closure function and a target scope variable, and the target wait click instruction is constructed based on a vue framework; The second control module is used to bind the target closure function to the target document object model DOM corresponding to the target button through the target event processing function, so as to assign the target asynchronous method corresponding to the target click event to the target scope variable based on the target closure function, so as to execute the target asynchronous method and wait through the wait keyword to intercept the new click event of the target button and realize the click self-locking of the target button.

7. The button click self-locking control device according to claim 6, characterized in that: The first control module is also used for: The target parameter corresponding to the target button is sent to the target event processing function through the target wait click instruction, so that the target event processing function can perform function binding based on the target parameter. The target parameter includes a first parameter, a second parameter and a third parameter. The first parameter is used to characterize whether an event binding or unbinding operation is required, the second parameter is used to characterize the DOM object to be bound, and the third parameter is used to characterize the asynchronous method to be bound.

8. The button click self-locking control device according to claim 7, characterized in that: The second control module is specifically used for: When the target event processing function detects that the value corresponding to the first parameter is a first preset value, the target closure function is bound to the target DOM corresponding to the target button based on the second parameter, and the first preset value is used to indicate that a binding operation needs to be performed on the event.

9. A button click self-locking control device, characterized in that: The button-click self-locking control device includes a processor, a memory, and a button-click self-locking control program stored in the memory and executable by the processor, wherein when the button-click self-locking control program is executed by the processor, the steps of the button-click self-locking control method as described in any one of claims 1 to 5 are implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a button-click self-locking control program, wherein when the button-click self-locking control program is executed by the processor, the steps of the button-click self-locking control method according to any one of claims 1 to 5 are implemented.