CN112905281A - View display method and device, electronic equipment and storage medium - Google Patents
View display method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN112905281A CN112905281A CN202110172572.8A CN202110172572A CN112905281A CN 112905281 A CN112905281 A CN 112905281A CN 202110172572 A CN202110172572 A CN 202110172572A CN 112905281 A CN112905281 A CN 112905281A
- Authority
- CN
- China
- Prior art keywords
- target
- resource locator
- view
- query parameter
- component
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 84
- 238000012544 monitoring process Methods 0.000 claims abstract description 41
- 230000001960 triggered effect Effects 0.000 claims abstract description 35
- 230000008859 change Effects 0.000 claims abstract description 29
- 238000009877 rendering Methods 0.000 claims description 11
- 238000012545 processing Methods 0.000 claims description 10
- 230000000694 effects Effects 0.000 abstract description 9
- 230000006870 function Effects 0.000 description 79
- 238000010586 diagram Methods 0.000 description 12
- 238000004590 computer program Methods 0.000 description 8
- 238000012423 maintenance Methods 0.000 description 7
- 238000004891 communication Methods 0.000 description 6
- 230000003287 optical effect Effects 0.000 description 6
- 230000006399 behavior Effects 0.000 description 5
- 230000008569 process Effects 0.000 description 5
- 230000003993 interaction Effects 0.000 description 4
- 230000009286 beneficial effect Effects 0.000 description 2
- 238000005538 encapsulation Methods 0.000 description 2
- 230000002452 interceptive effect Effects 0.000 description 2
- 230000009191 jumping Effects 0.000 description 2
- 239000013307 optical fiber Substances 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 239000004065 semiconductor Substances 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000004806 packaging method and process Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/451—Execution arrangements for user interfaces
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3003—Monitoring arrangements specially adapted to the computing system or computing system component being monitored
- G06F11/302—Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Human Computer Interaction (AREA)
- Mathematical Physics (AREA)
- Quality & Reliability (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
The present disclosure discloses a view display method, apparatus, electronic device and storage medium, the method comprising: when the subscribed target component is detected to be triggered, calling a pre-packaged resource locator marking method to mark a target resource locator corresponding to the subscribed target component; calling a callback function matched with the target query parameter when monitoring the change of the target query parameter in the target resource locator; and determining a target view corresponding to the target resource locator based on the callback function and the target query parameter, and sending the target view to the client so as to enable the client to display the target view. According to the technical scheme, the problem that in the prior art, the displayed view is inconsistent with the view corresponding to the trigger operation, so that user experience is poor is solved, and the displayed view is matched with the view corresponding to the trigger operation when the view is updated according to the monitoring change URL, so that the technical effect of the user experience is improved.
Description
Technical Field
The present disclosure relates to computers, and in particular, to a method and an apparatus for displaying a view, an electronic device, and a storage medium.
Background
Currently, a browser usually locates a page according to a Uniform Resource Locator (URL).
When browsing pages based on a browser, the history object in the browser provides a corresponding API (Application Programming Interface) to record the newly added URL and replace the updated URL.
However, in the case that the user interacts with the corresponding component in the page for the first time, the maintenance state corresponding to the component may be updated, and the parameter of the maintenance state may be updated to the URL, as shown in fig. 1, when the user interaction causes the view of the diagram to change, the component state may be updated, and the view and the URL corresponding to the view may be updated according to the component state. When the user triggers the corresponding interactive behavior under the component again, the maintenance state of the component may not change any more, and correspondingly, the URL may not change any more, resulting in a problem that the corresponding content cannot be displayed or hidden after the forward or backward key is triggered, thereby causing a situation that the triggering operation is inconsistent with the rendered view.
Disclosure of Invention
The disclosure provides a view display method, a view display device, an electronic device and a storage medium, so as to realize URL parameter-based drive view display, thereby realizing the technical effect that the displayed view is consistent with the trigger operation of a user.
In a first aspect, an embodiment of the present disclosure provides a view display method, including:
when detecting that an operation control in a subscribed target assembly is triggered, calling a pre-packaged resource locator marking method to mark a target resource locator corresponding to the operation control;
calling a callback function matched with the target query parameter when monitoring the change of the target query parameter in the target resource locator;
and determining a target view corresponding to the target resource locator based on the callback function and the target query parameter, and sending the target view to a client so as to enable the client to display the target view.
In a second aspect, embodiments of the present disclosure also provide a view display apparatus, including:
the resource locator recording module is used for calling a pre-packaged resource locator marking method to mark a target resource locator corresponding to an operation control when the fact that the operation control in the subscribed target assembly is triggered is detected;
the callback function calling module is used for calling a callback function matched with the target query parameter when the change of the target query parameter in the target resource locator is monitored;
and the target view display module is used for determining a target view corresponding to the target resource locator based on the callback function and the target query parameter, and sending the target view to a client so as to enable the client to display the target view.
In a third aspect, an embodiment of the present disclosure further provides an electronic device, where the electronic device includes:
one or more processors;
a storage device for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors implement the view display method according to the embodiment of the present disclosure.
In a fourth aspect, the disclosed embodiments also provide a storage medium containing computer-executable instructions, which when executed by a computer processor, are used to perform the view display method according to the disclosed embodiments.
According to the technical scheme, the query parameter in the URL can be determined by monitoring the URL, the query parameter is input into the corresponding callback function, the target view corresponding to the updated URL is obtained, the corresponding view is displayed according to the parameter in the URL, the problem that in the prior art, when the URL is updated according to the change of the state of the component, the maintenance state of the component is in the non-updated state, the displayed view is inconsistent with the view corresponding to the trigger operation, and therefore user experience is poor is solved, when the view is updated according to the URL which changes are monitored, the displayed view is matched with the view corresponding to the trigger operation, and therefore the technical effect of the user experience is improved.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and features are not necessarily drawn to scale.
FIG. 1 is a flow chart illustrating a display view provided by the prior art;
fig. 2 is a flowchart illustrating a view display method according to a first embodiment of the disclosure;
FIG. 3 is a schematic view of an interface provided in an embodiment of the present disclosure;
fig. 4 is a flowchart illustrating a view display method according to a second embodiment of the disclosure;
fig. 5 is a schematic structural diagram of a view display device according to a third embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of an electronic device according to a fourth embodiment of the disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
Example one
Fig. 2 is a schematic flowchart of a view display method provided in an embodiment of the present disclosure, where the embodiment of the present disclosure is applicable to a single-page application, and the method may be executed by a view display apparatus, where the apparatus may be implemented in the form of software and/or hardware, and the hardware may be an electronic device, and the electronic device may be a mobile terminal or a PC terminal, and the like.
As shown in fig. 2, the method includes:
s110, when the fact that the operation control in the subscribed target assembly is triggered is detected, a pre-packaged resource locator marking method is called to mark the target resource locator corresponding to the operation control.
It should be noted that, in a single application page, if there is a user interaction behavior, a URL corresponding to the interaction behavior may be recorded. A page can include a plurality of controls, and the plurality of controls can be taken as one component. The user may trigger the display of various components in the page. The predetermined component to be monitored can be used as a subscribed component, that is, after one component is triggered, a plurality of operation controls under the component can be triggered, and the component with the corresponding view can be displayed as the component to be monitored, and of course, a user can also set the corresponding component to be monitored according to actual requirements. Accordingly, in an actual application process, when a user triggers a component, it may be determined whether the currently triggered component is a subscribed component, and if so, the currently triggered component may be used as a subscribed target component. The browser provides a history, a cache state (may record a triggered URL address corresponding to a subscribed target component), the number of URL addresses that may be recorded in the history, the relocation state is limited, and when a new URL address is generated, the new URL address may be updated in the history, the relocation state. Meanwhile, the browser URL address may be modified by the history. In order to determine whether the URL address changes, the two methods may be packaged together, and a monitoring component for monitoring the URL address in the browser is provided to determine whether the URL changes due to the user triggering the forward and backward buttons. That is, the history and history reporcestate can only record, update, and jump to the next URL, but the application cannot determine the URL, that is, the application cannot determine whether the URL address changes, and therefore, it is necessary to monitor the change of the URL caused by the user's trigger operation. The target resource locator is the resource locator corresponding to the triggered operation control.
When a user triggers a target component, whether the triggered target component is a subscribed component can be determined according to a predetermined record table (a table for recording subscribed components), and if so, a pre-packaged resource location record and an update method can be called to update a resource locator corresponding to the record and the subscribed component. For example, referring to fig. 3, in the same page, a component corresponding to a list page a is a subscribed component, and when a control a corresponding to the list page is triggered, a URL address corresponding to the list page a, that is, an address corresponding to the schematic diagram (1) in fig. 3, may be recorded based on a packaging method. The operation control in the subscribed target component may be an editing or popup display control, and when the popup control B is triggered, the pre-packaged resource locator record and the update method may also be called to update the target resource locator recorded corresponding to the operation control B, that is, the URL address corresponding to the schematic diagram (2) in fig. 3. Correspondingly, if the user triggers the editing control C, the URL address corresponding to the editing control C may be recorded based on an encapsulation method, where the URL address includes the query parameter corresponding to the operation, that is, the URL address corresponding to the schematic diagram (3) in fig. 3.
It should be noted that, when the target resource locators corresponding to the operation controls B and C are recorded in an updated manner, the edit popup is not displayed, that is, the display interface is not changed for the user.
Optionally, when it is detected that an operation control in a subscribed target component is triggered, invoking a pre-packaged resource locator record and an updating method to update a target resource locator whose record corresponds to the operation control includes: when the subscribed target component is detected to be triggered, recording a first resource locator corresponding to the subscribed target component based on history. When the operation control in the subscribed target assembly is detected to be triggered, calling the pre-packaged resource locator, and recording the target resource locator corresponding to the operation control.
The first resource locator is a resource locator corresponding to a previous page, and the target resource locator is a resource locator corresponding to a page to be jumped to.
It can be understood that: when the subscribed target component is detected to be triggered, recording a first resource locator corresponding to the subscribed target component based on history. When the user triggers the operation control in the subscribed target component, the URL corresponding to the page to be jumped to is recorded based on the same mode, and the URL at this time can be used as the target resource locator.
And S120, calling a callback function matched with the target query parameter when the target query parameter in the target resource locator is monitored to be changed.
The target query parameter may be a character string corresponding to a target field in the target resource locator. The controls in the subscribed target component that can generate the user interaction behavior can include one or more controls, for example, an edit manipulation control, a popup presentation control, and the like can be included in the list page. The query parameters corresponding to different operation controls are different, and the query parameters corresponding to different interactive behaviors (operation controls) can be subscribed in advance, so that corresponding views are generated based on the query parameters included in the URL. The callback function may be understood as a view-incoming function for processing the input parameters and determining a view matching the input parameters.
Specifically, when the URL address is updated in the encapsulation method, the monitoring component may monitor whether the parameter in the updated URL component is changed, and whether the changed parameter is the subscribed query parameter. If so, a callback function matching the target query parameter may be invoked.
In this embodiment, a specific implementation manner of determining whether the target query parameter changes may be referred to the following description: when the change of the target query parameter in the target resource locator is monitored, calling a callback function matched with the target query parameter, wherein the callback function comprises the following steps: monitoring whether a target query parameter in the target resource locator is consistent with a historical query parameter in the first resource locator or not based on a preset monitoring component; the monitoring component is used for monitoring the resource locator of the update record; if not, calling a callback function matched with the target query parameter.
When the component is loaded, that is, when the subscribed target component is triggered, a listener, that is, a listening component, may be automatically generated to listen whether the URL address stored in the encapsulated method has changed. That is, the listening component is configured to listen whether a target string of a target field in the URL changes. The way to determine the specific change may be: and when the target resource locator and the first resource locator are determined, respectively calling a target character string of a target field, wherein the target character string can be a target query parameter and a path, and under the condition that the paths are consistent, determining whether the target query parameters of two adjacent records are the same, optionally, determining whether the query parameters are the same in a character string comparison mode. If not, determining whether the target query parameter is a subscribed query parameter, and if so, calling a callback function corresponding to the target query parameter.
It should be noted that the callback functions corresponding to different query parameters are different, because the views to be displayed are different.
S130, determining a target view corresponding to the target resource locator based on the callback function and the target query parameter, and sending the target view to the client so that the client can display the target view.
Specifically, the target query parameter may be input into the callback function to obtain a target view corresponding to the target resource locator, and the target view may be sent to the client, so that the client may display the target view.
For example, after the target query parameter is input to the corresponding callback function, the view corresponding to (2) or (3) in fig. 3 may be displayed.
Optionally, the determining a target view corresponding to the target resource locator based on the callback function and the target query parameter includes: processing the target query parameter based on the callback function, and determining a view to be rendered corresponding to the target resource positioning; and rendering the view to be rendered to obtain the target view.
The component for rendering the view to be rendered may be a view rendering component.
Specifically, after the target query parameter is input into the corresponding callback function, the view to be rendered, which is matched with the target query parameter, can be obtained. And processing the view to be rendered through the view rendering component to obtain the target view.
According to the technical scheme, the query parameter in the URL can be determined by monitoring the URL, the query parameter is input into the corresponding callback function, the target view corresponding to the updated URL is obtained, the corresponding view is displayed according to the parameter in the URL, the problem that in the prior art, when the URL is updated according to the change of the state of the component, the maintenance state of the component is in the non-updated state, the displayed view is inconsistent with the view corresponding to the trigger operation, and therefore user experience is poor is solved, when the view is updated according to the URL which changes are monitored, the displayed view is matched with the view corresponding to the trigger operation, and therefore the technical effect of the user experience is improved.
On the basis of the technical scheme, when the corresponding callback function is called according to the target query parameter and before the corresponding view is determined based on the callback function, the query parameters in the subscribed component and the callback function corresponding to each query parameter can be determined.
Optionally, a corresponding relationship between at least one subscribed component, the query parameter corresponding to each subscribed component, and the callback function corresponding to each query parameter is established, so that when a change in the target query parameter is detected, the callback function matched with the target query parameter is called.
In the code development stage, the target component to be monitored can be determined, and the target component to be monitored can be taken as the subscribed component. The operation corresponding to each subscribed component may include multiple, optional, operations such as editing, jumping to a next page, displaying a popup window, and the like. Each operation may correspond to a query parameter, and correspondingly, in order to display a corresponding view, a callback function corresponding to each query parameter may be determined, so that after the corresponding query parameter is input into the callback function, a view matching the query parameter may be obtained.
It can be understood that at least one component to be monitored is determined, and the component to be monitored is taken as a subscribed component; aiming at each subscribed component, determining at least one query parameter corresponding to the current subscribed component; the query parameters are matched with trigger operations in the currently subscribed components; determining a callback function corresponding to the current query parameter aiming at each query parameter; and establishing the corresponding relation according to at least one query parameter corresponding to each subscribed component and a callback function corresponding to at least one query parameter.
According to the technical scheme, the monitoring component is preset, whether the corresponding query parameter changes is monitored based on the monitoring component, and then the corresponding display view is determined according to the changed query parameter, so that the effect of view synchronization can be achieved only by introducing the monitoring component and the corresponding parameter. Furthermore, due to a rendering mechanism driven by the URL parameter, the rendering of the view and the URL change are decoupled, and the technical effect of code decoupling is achieved.
It should be further noted that, the user may set the subscribed component, the corresponding query parameter in the subscribed component, and the callback function corresponding to the query parameter according to actual requirements.
Example two
As an alternative embodiment of the foregoing embodiment, fig. 4 is a schematic flow chart of a view display method provided in the embodiment of the present disclosure. The technical terms that are the same as or corresponding to the above embodiments are not repeated herein.
As shown in fig. 4, the method includes:
s201, according to the triggering operation of a user, calling a pre-packaged resource locator marking method to mark a target resource locator corresponding to the operation control.
Specifically, when it is detected that a user triggers a certain control, a recording method in a pre-packaged resource locator marking method is called, and a resource locator URL corresponding to a triggering operation is recorded. And calling the history in the packaged method, jumping to the URL corresponding to the trigger operation, and recording the URL to be jumped to.
That is, the history, i.e., the recording method, and the history, i.e., the resource locator update method, provided by the browser can jump to the next URL, and the two methods can be encapsulated, and when the URL of the browser needs to be changed, the encapsulated method push or replace is called.
S202, monitoring the updated target resource locator in the browser based on the monitoring component.
It should be noted that the browser URL change listening component (historyListener) can be encapsulated for view consumption in a low-intrusive manner. The historyListener may monitor the subscribed URL query parameters and call a callback function corresponding to the change of the subscribed query parameters.
Specifically, when the subscribed component is loaded, a listener, that is, a listening component, may be automatically generated, and the listening component may obtain a resource locator corresponding to the trigger operation.
S203, judging whether the query parameter in the target resource locator changes, if so, executing S204; if not, go to S205.
Each component may correspond to a plurality of operations, and each operation may correspond to a query parameter. A determination may be made based on the listening component as to whether a change has occurred in the query parameter in the target resource locator.
In particular, a listener, i.e., a listening component, can be automatically generated when the component is loaded. The monitoring component may monitor whether the URL parameter changes, for example, a path in a target field in a previous URL is a, the query parameter is B, after a certain control is triggered in the view, a path in a corresponding target field of the target URL is a, the query parameter is C, and at this time, it may be determined that the query parameter changes, and the monitoring component may call a callback function corresponding to the query parameter C.
That is, when the component is loaded, a listener may be automatically generated for listening to a change in the URL parameter, and if the subscribed parameter changes, the changed parameter may be transferred to the corresponding callback function for execution.
And S204, calling a callback function transmitted by the view, and updating the view state.
The query parameter is usually a URL query parameter that the component depends on, so the query parameter can be input to a callback function called by the listening component and matching with the query parameter. The callback function can process the query parameters and update the view state.
And S205, ending.
That is, the query parameters are unchanged, and the view may not be updated.
S206, the view rendering component renders the view based on the updated view state to obtain a target view displayed to the client.
Specifically, the view rendering component renders the view based on the updated view state to obtain the target view, and the target view can be sent to the client for displaying at the client, so that the technical effect that the displayed view is matched with the trigger operation is realized.
On the basis of the technical scheme, when the link corresponding to the target view is sent to other users, the view opened by the other users is completely consistent with the target view.
According to the technical scheme, the query parameter in the URL can be determined by monitoring the URL, the query parameter is input into the corresponding callback function, the target view corresponding to the updated URL is obtained, the corresponding view is displayed according to the parameter in the URL, the problem that in the prior art, when the URL is updated according to the change of the state of the component, the maintenance state of the component is in the non-updated state, the displayed view is inconsistent with the view corresponding to the trigger operation, and therefore user experience is poor is solved, when the view is updated according to the URL which changes are monitored, the displayed view is matched with the view corresponding to the trigger operation, and therefore the technical effect of the user experience is improved.
EXAMPLE III
Fig. 5 is a schematic structural diagram of a view display device according to a third embodiment of the present disclosure, and as shown in fig. 5, the view display device includes: a resource locator recording module 310, a callback function calling module 320, and a target view presentation module 330.
The resource locator recording module 310 is configured to, when it is detected that an operation control in a subscribed target component is triggered, call a pre-packaged resource locator marking method to mark a target resource locator corresponding to the operation control; the callback function calling module 320 is used for calling a callback function matched with the target query parameter when the change of the target query parameter in the target resource locator is monitored; and the target view display module 330 is configured to determine a target view corresponding to the target resource locator based on the callback function and the target query parameter, and send the target view to a client, so that the client displays the target view.
On the basis of the above technical solutions, the resource locator recording module is configured to: when the subscribed target component is detected to be triggered, recording a first resource locator corresponding to the subscribed target component based on history. When the operation control in the subscribed target assembly is detected to be triggered, calling the pre-packaged resource locator, and recording the target resource locator corresponding to the operation control.
On the basis of the above technical solutions, the callback function calling module includes:
the parameter matching unit is used for monitoring whether a target query parameter in the target resource locator is consistent with a historical query parameter in the first resource locator or not based on a preset monitoring component; the monitoring component is used for monitoring the resource locator of the update record; if not, calling a callback function matched with the target query parameter.
On the basis of the above technical solutions, the target view display module includes:
a view to be rendered determining unit, configured to process the target query parameter based on the callback function, and determine a view to be rendered corresponding to the target resource location;
and the target view determining unit is used for rendering the view to be rendered to obtain the target view.
On the basis of the above technical solutions, the apparatus further includes: and the monitoring control deleting module is used for deleting the monitoring control corresponding to the previous view of the target view.
On the basis of the above technical solutions, the apparatus further includes: the corresponding relation establishing module is used for establishing the corresponding relation among at least one subscribed component, the query parameter corresponding to each subscribed component and the callback function corresponding to each query parameter, so that the callback function matched with the target query parameter is called when the target query parameter is detected to be changed.
On the basis of the above technical solutions, the correspondence relationship establishing module includes:
the device comprises a subscribed component determining unit, a monitored component determining unit and a monitoring unit, wherein the subscribed component determining unit is used for determining at least one component to be monitored and taking the component to be monitored as a subscribed component; the query parameter recording unit is used for determining at least one query parameter corresponding to the current subscribed component aiming at each subscribed component; the query parameters are matched with trigger operations in the currently subscribed components; the callback function determining unit is used for determining a callback function corresponding to the current query parameter aiming at each query parameter; and the corresponding relation establishing unit is used for establishing the corresponding relation according to at least one query parameter corresponding to each subscribed component and the callback function corresponding to at least one query parameter.
According to the technical scheme, the query parameter in the URL can be determined by monitoring the URL, the query parameter is input into the corresponding callback function, the target view corresponding to the updated URL is obtained, the corresponding view is displayed according to the parameter in the URL, the problem that in the prior art, when the URL is updated according to the change of the state of the component, the maintenance state of the component is in the non-updated state, the displayed view is inconsistent with the view corresponding to the trigger operation, and therefore user experience is poor is solved, when the view is updated according to the URL which changes are monitored, the displayed view is matched with the view corresponding to the trigger operation, and therefore the technical effect of the user experience is improved.
The view display device provided by the embodiment of the disclosure can execute the view display method provided by any embodiment of the disclosure, and has corresponding functional modules and beneficial effects of the execution method.
It should be noted that, the units and modules included in the apparatus are merely divided according to functional logic, but are not limited to the above division as long as the corresponding functions can be implemented; in addition, specific names of the functional units are only used for distinguishing one functional unit from another, and are not used for limiting the protection scope of the embodiments of the present disclosure.
Example four
Referring now to fig. 6, a schematic diagram of an electronic device (e.g., the terminal device or the server in fig. 6) 600 suitable for implementing embodiments of the present disclosure is shown. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 6, the electronic device 600 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 601 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage means 605 into a Random Access Memory (RAM) 603. In the RAM603, various programs and data necessary for the operation of the electronic apparatus 600 are also stored. The processing device 601, the ROM602, and the RAM603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Generally, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 606 including, for example, magnetic tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. While fig. 6 illustrates an electronic device 600 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated by the flow chart. In such embodiments, the computer program may be downloaded and installed from a network through the communication device 609, or installed from the storage device 606, or installed from the ROM 702. The computer program, when executed by the processing device 601, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
The electronic device provided by the embodiment of the present disclosure and the view display method provided by the above embodiment belong to the same inventive concept, and technical details that are not described in detail in the embodiment can be referred to the above embodiment, and the embodiment has the same beneficial effects as the above embodiment.
EXAMPLE five
The disclosed embodiments provide a computer storage medium having stored thereon a computer program that, when executed by a processor, implements the view display method provided by the above-described embodiments.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to:
when detecting that an operation control in a subscribed target assembly is triggered, calling a pre-packaged resource locator record and an updating method to update a target resource locator recorded corresponding to the operation control;
calling a callback function matched with the target query parameter when monitoring the change of the target query parameter in the target resource locator;
and determining a target view corresponding to the target resource locator based on the callback function and the target query parameter, and sending the target view to a client so as to enable the client to display the target view.
Computer program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including but not limited to an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of a unit/module does not in some cases constitute a limitation on the unit itself, for example, a callback function call module may also be described as a "function call module".
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
According to one or more embodiments of the present disclosure, [ example one ] there is provided a view display method, including:
when detecting that an operation control in a subscribed target assembly is triggered, calling a pre-packaged resource locator marking method to mark a target resource locator corresponding to the operation control;
calling a callback function matched with the target query parameter when monitoring the change of the target query parameter in the target resource locator;
and determining a target view corresponding to the target resource locator based on the callback function and the target query parameter, and sending the target view to a client so as to enable the client to display the target view.
According to one or more embodiments of the present disclosure, [ example two ] there is provided a view display method, further comprising:
optionally, the calling a pre-packaged resource locator marking method to mark the target resource locator corresponding to the operation control when detecting that the operation control in the subscribed target component is triggered, and the calling a pre-packaged resource locator marking method to mark the target resource locator corresponding to the operation control when detecting that the operation control in the subscribed target component is triggered includes:
when the subscribed target component is detected to be triggered, recording a first resource locator corresponding to the subscribed target component based on a resource locator recording method, and updating the first resource locator based on a resource locator updating method;
when the operation control in the subscribed target assembly is detected to be triggered, a pre-packaged resource locator marking method is called, and the target resource locator corresponding to the operation control is updated and recorded.
According to one or more embodiments of the present disclosure, [ example three ] there is provided a view display method, further comprising:
optionally, when a change of the target query parameter in the target resource locator is monitored, invoking a callback function matched with the target query parameter includes:
monitoring whether a target query parameter in the target resource locator is consistent with a historical query parameter in the first resource locator or not based on a preset monitoring component; the monitoring component is used for monitoring the resource locator of the update record;
if not, calling a callback function matched with the target query parameter.
According to one or more embodiments of the present disclosure, [ example four ] there is provided a view display method, further comprising:
optionally, the determining a target view corresponding to the target resource locator based on the callback function and the target query parameter includes:
processing the target query parameter based on the callback function, and determining a view to be rendered corresponding to the target resource positioning;
and rendering the view to be rendered to obtain the target view.
According to one or more embodiments of the present disclosure, [ example five ] there is provided a view display method, further comprising:
optionally, the monitoring control corresponding to the previous view of the target view is deleted.
According to one or more embodiments of the present disclosure, [ example six ] there is provided a view display method, further comprising:
optionally, a corresponding relationship between at least one subscribed component, the query parameter corresponding to each subscribed component, and the callback function corresponding to each query parameter is established, so that when a change in the target query parameter is detected, the callback function matched with the target query parameter is called.
According to one or more embodiments of the present disclosure, [ example seven ] there is provided a view display method, further comprising:
optionally, the establishing a correspondence between at least one subscribed component, the query parameter corresponding to each subscribed component, and the callback function corresponding to each query parameter includes:
determining at least one component to be monitored, and taking the component to be monitored as a subscribed component;
aiming at each subscribed component, determining at least one query parameter corresponding to the current subscribed component; the query parameters are matched with trigger operations in the currently subscribed components;
determining a callback function corresponding to the current query parameter aiming at each query parameter;
and establishing the corresponding relation according to at least one query parameter corresponding to each subscribed component and a callback function corresponding to at least one query parameter.
According to one or more embodiments of the present disclosure, [ example eight ] there is provided a view display apparatus including:
the resource locator recording module is used for calling a pre-packaged resource locator record and an updating method to update a target resource locator recorded corresponding to an operation control when the operation control in the subscribed target component is detected to be triggered;
the callback function calling module is used for calling a callback function matched with the target query parameter when the change of the target query parameter in the target resource locator is monitored;
and the target view display module is used for determining a target view corresponding to the target resource locator based on the callback function and the target query parameter, and sending the target view to a client so as to enable the client to display the target view.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.
Further, while operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.
Claims (10)
1. A method of displaying a view, comprising:
when detecting that an operation control in a subscribed target assembly is triggered, calling a pre-packaged resource locator marking method to mark a target resource locator corresponding to the operation control;
calling a callback function matched with the target query parameter when monitoring the change of the target query parameter in the target resource locator;
and determining a target view corresponding to the target resource locator based on the callback function and the target query parameter, and sending the target view to a client so as to enable the client to display the target view.
2. The method according to claim 1, wherein the resource locator marking method includes a resource locator recording method and a resource locator updating method, and the step of calling a pre-packaged resource locator marking method to mark the target resource locator corresponding to the operation control when detecting that the operation control in the subscribed target component is triggered comprises:
when the subscribed target component is detected to be triggered, recording a first resource locator corresponding to the subscribed target component based on a resource locator recording method, and updating the first resource locator based on a resource locator updating method;
when the operation control in the subscribed target assembly is detected to be triggered, a pre-packaged resource locator marking method is called, and the target resource locator corresponding to the operation control is updated and recorded.
3. The method of claim 2, wherein calling a callback function matching a target query parameter when a change in the target query parameter in the target resource locator is detected comprises:
monitoring whether a target query parameter in the target resource locator is consistent with a historical query parameter in the first resource locator or not based on a preset monitoring component; the monitoring component is used for monitoring the resource locator of the update record;
if not, calling a callback function matched with the target query parameter.
4. The method of claim 1, wherein determining the target view corresponding to the target resource locator based on the callback function and the target query parameters comprises:
processing the target query parameter based on the callback function, and determining a view to be rendered corresponding to the target resource positioning;
and rendering the view to be rendered to obtain the target view.
5. The method of claim 1, further comprising:
and deleting the monitoring control corresponding to the previous view of the target view.
6. The method of claim 1, further comprising:
and establishing a corresponding relation among at least one subscribed component, the query parameter corresponding to each subscribed component and the callback function corresponding to each query parameter, so as to call the callback function matched with the target query parameter when the target query parameter is detected to be changed.
7. The method of claim 6, wherein establishing a correspondence between at least one subscribed component, the query parameter corresponding to each subscribed component, and the callback function corresponding to each query parameter comprises:
determining at least one component to be monitored, and taking the component to be monitored as a subscribed component;
aiming at each subscribed component, determining at least one query parameter corresponding to the current subscribed component; the query parameters are matched with trigger operations in the currently subscribed components;
determining a callback function corresponding to the current query parameter aiming at each query parameter;
and establishing the corresponding relation according to at least one query parameter corresponding to each subscribed component and a callback function corresponding to at least one query parameter.
8. A view display apparatus, comprising:
the resource locator recording module is used for calling a pre-packaged resource locator marking method to mark a target resource locator corresponding to an operation control when the fact that the operation control in the subscribed target assembly is triggered is detected;
the callback function calling module is used for calling a callback function matched with the target query parameter when the change of the target query parameter in the target resource locator is monitored;
and the target view display module is used for determining a target view corresponding to the target resource locator based on the callback function and the target query parameter, and sending the target view to a client so as to enable the client to display the target view.
9. An electronic device, characterized in that the electronic device comprises:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the view display method of any of claims 1-7.
10. A storage medium containing computer executable instructions for performing the view display method of any one of claims 1-7 when executed by a computer processor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110172572.8A CN112905281A (en) | 2021-02-08 | 2021-02-08 | View display method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110172572.8A CN112905281A (en) | 2021-02-08 | 2021-02-08 | View display method and device, electronic equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112905281A true CN112905281A (en) | 2021-06-04 |
Family
ID=76122761
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110172572.8A Pending CN112905281A (en) | 2021-02-08 | 2021-02-08 | View display method and device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112905281A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113885997A (en) * | 2021-10-19 | 2022-01-04 | 深圳市元征科技股份有限公司 | Dialog box display method and device, electronic equipment and storage medium |
CN113961120A (en) * | 2021-10-20 | 2022-01-21 | 上汽通用五菱汽车股份有限公司 | Complex page display method, device, equipment and medium based on vehicle-mounted application |
CN114969583A (en) * | 2022-04-02 | 2022-08-30 | 北京达佳互联信息技术有限公司 | Data synchronization method, device, equipment and storage medium |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106528601A (en) * | 2016-09-23 | 2017-03-22 | 北京五八信息技术有限公司 | Method and device for dynamically configuring module |
CN109062626A (en) * | 2018-07-09 | 2018-12-21 | 北京奇艺世纪科技有限公司 | Exchange method, device and the equipment of Web page component and Native component |
CN109446457A (en) * | 2018-09-25 | 2019-03-08 | 平安普惠企业管理有限公司 | Update method, terminal device and the medium of page data |
CN109710622A (en) * | 2018-10-31 | 2019-05-03 | 阿里巴巴集团控股有限公司 | A kind of data-updating method, device and system |
CN110221872A (en) * | 2019-04-22 | 2019-09-10 | 五八有限公司 | Method for page jump, device, electronic equipment and storage medium |
CN111897620A (en) * | 2020-08-20 | 2020-11-06 | 北京字节跳动网络技术有限公司 | Interaction method and device and electronic equipment |
-
2021
- 2021-02-08 CN CN202110172572.8A patent/CN112905281A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106528601A (en) * | 2016-09-23 | 2017-03-22 | 北京五八信息技术有限公司 | Method and device for dynamically configuring module |
CN109062626A (en) * | 2018-07-09 | 2018-12-21 | 北京奇艺世纪科技有限公司 | Exchange method, device and the equipment of Web page component and Native component |
CN109446457A (en) * | 2018-09-25 | 2019-03-08 | 平安普惠企业管理有限公司 | Update method, terminal device and the medium of page data |
CN109710622A (en) * | 2018-10-31 | 2019-05-03 | 阿里巴巴集团控股有限公司 | A kind of data-updating method, device and system |
CN110221872A (en) * | 2019-04-22 | 2019-09-10 | 五八有限公司 | Method for page jump, device, electronic equipment and storage medium |
CN111897620A (en) * | 2020-08-20 | 2020-11-06 | 北京字节跳动网络技术有限公司 | Interaction method and device and electronic equipment |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113885997A (en) * | 2021-10-19 | 2022-01-04 | 深圳市元征科技股份有限公司 | Dialog box display method and device, electronic equipment and storage medium |
CN113961120A (en) * | 2021-10-20 | 2022-01-21 | 上汽通用五菱汽车股份有限公司 | Complex page display method, device, equipment and medium based on vehicle-mounted application |
CN114969583A (en) * | 2022-04-02 | 2022-08-30 | 北京达佳互联信息技术有限公司 | Data synchronization method, device, equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110046021B (en) | Page display method, device, system, equipment and storage medium | |
CN112905281A (en) | View display method and device, electronic equipment and storage medium | |
CN111400625B (en) | Page processing method and device, electronic equipment and computer readable storage medium | |
CN110658960A (en) | Message processing method and device and electronic equipment | |
CN111596991A (en) | Interactive operation execution method and device and electronic equipment | |
CN113806212A (en) | Application program exception positioning method and device and electronic equipment | |
CN111506376A (en) | Feedback information display method and device, readable medium and electronic equipment | |
CN110825481A (en) | Method and device for displaying page information corresponding to page tag and electronic equipment | |
US20230401377A1 (en) | Document creation method and apparatus, and device and storage medium | |
CN112269959A (en) | Display content control method and device, readable medium and electronic equipment | |
CN112307375A (en) | Page display method and device, electronic equipment and computer readable medium | |
CN110717126A (en) | Page browsing method and device, electronic equipment and computer readable storage medium | |
CN114428925A (en) | Page rendering method and device, electronic equipment and computer readable medium | |
CN112256372B (en) | Information processing method and device and electronic equipment | |
CN111581664B (en) | Information protection method and device | |
CN110069186B (en) | Method and equipment for displaying operation interface of application | |
CN110619101B (en) | Method and apparatus for processing information | |
US20240289084A1 (en) | Method, apparatus, and electronic device for controlling display | |
CN115526953A (en) | Method and device for generating view, electronic equipment and storage medium | |
CN115134254A (en) | Network simulation method, device, equipment and storage medium | |
CN111552531B (en) | Page display method, device, terminal and storage medium | |
JP2023527174A (en) | Video special effect arrangement method, video special effect arrangement device, device and storage medium | |
CN111382038B (en) | Method, device, electronic equipment and storage medium for reporting service data | |
CN111309323A (en) | Parameter initialization method and device and electronic equipment | |
CN112306317A (en) | Unread message notification method and device and electronic equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |