Webpage menu switching method and device, computer equipment and storage medium

By listening to changes in the browser address bar URL, real-time update of web page menus and switching of multi-system menus are achieved, solving the problems of difficulty in updating menu lists and wasting resources in the existing technology, and improving the reusability and maintenance of the code.

CN119961544APending Publication Date: 2025-05-09CHERY AUTOMOBILE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510005057.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-02
Publication Date
2025-05-09

AI Technical Summary

Technical Problem

The existing technology cannot realize real-time update of the menu list on the left, and the public components and public methods cannot be reused, resulting in maintenance difficulties and waste of resources, and requires the deployment of multiple systems.

Method used

By monitoring the changes in the browser address bar URL, using the callback function to listen to the routing code, generate the listening results, and perform the web page menu switching action based on the results, realizing the display and switching of multiple system menus.

Benefits of technology

It realizes high reusability of public components and public methods and maintainability of code, reducing the waste of server resources. Only one set of servers is required to deploy, and the waste of user network resources is also reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119961544A_ABST
    Figure CN119961544A_ABST
Patent Text Reader

Abstract

The invention relates to a webpage menu switching method and device, computer equipment and a storage medium, and the method comprises the steps: obtaining a system menu set and collection menu data of a user; based on the system menu set and the collection menu data, judging whether a browser address bar url meets a preset monitoring condition or not; and if the browser address bar url meets the preset monitoring condition, monitoring a routing code in the browser address bar url by using a callback function to generate a monitoring result, and executing at least one webpage menu switching action according to the monitoring result to generate a final switching result of the webpage menu. Therefore, the problems that a left menu list cannot be updated in real time, a common component, a common method and the like cannot reuse later codes, maintenance is difficult, multiple sets of systems need to be deployed, and resource waste is caused in the prior art are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of front-end web page menu switching, and in particular to a web page menu switching method, device, computer equipment and storage medium. Background Art

[0002] Web page menu is an important part of user navigation and interaction. Its design and implementation directly affect user experience and system efficiency. Traditional web page menu switching methods have many limitations, especially in multi-system integration and dynamic content display. With the development of Internet technology, users have higher requirements for efficient, smooth and personalized menu switching experience.

[0003] In the related technologies, most of them adopt the method of copying multiple codes to create multiple warehouses, deploying multiple websites and not jumping within the web page.

[0004] The relevant technology cannot achieve real-time update of the left menu list. Public components and public methods cannot reuse later codes, making maintenance difficult. It is necessary to deploy multiple systems, resulting in a waste of resources, which needs to be improved urgently. Summary of the invention

[0005] The present application provides a web page menu switching method, device, computer equipment and storage medium to solve the problems that the related technology cannot achieve real-time update of the left menu list, public components, public methods, etc. cannot reuse later codes, maintenance is difficult, multiple systems need to be deployed, resulting in waste of resources, etc.

[0006] The first aspect of the present application provides a web page menu switching method, comprising the following steps: obtaining a user's system menu set and favorite menu data; based on the system menu set and the favorite menu data, determining whether a browser address bar URL satisfies a preset monitoring condition; if the browser address bar URL satisfies the preset monitoring condition, using a callback function to monitor a routing code in the browser address bar URL, generating a monitoring result, and executing at least one web page menu switching action according to the monitoring result to generate a final switching result of the web page menu.

[0007] The embodiment of the present application changes the menus of different systems by monitoring the URL changes in the browser address bar to achieve switching of multiple system menu displays, thereby achieving high reuse of common components and common methods and making the code more maintainable. Only one set of server resources needs to be deployed to reduce the cost of server resources, and resource requests for the public part only need to be requested once, thereby reducing the waste of user network resources.

[0008] Optionally, in one embodiment of the present application, at least one web page menu switching action is performed according to the monitoring result to generate a final switching result of the web page menu, including: when a favorite menu button is clicked or a web page jump page is clicked, the left menu list of the web page menu is updated according to the monitoring result to obtain an updated menu list; and the final switching result of the web page menu is determined according to the updated menu list.

[0009] The embodiment of the present application can change the menus of different systems by monitoring the URL changes in the browser address bar to achieve switching of multiple system menu displays, further ensuring that resource requests for the public part only need to be requested once, reducing the waste of user network resources.

[0010] Optionally, in one embodiment of the present application, after updating the left menu list of the web page menu according to the monitoring results, it also includes: using a responsive data mechanism to trigger browser re-rendering to generate updated web page left menu data; updating the route jump content area according to the updated web page left menu data to generate a final route jump content area.

[0011] The embodiment of the present application uses a responsive data mechanism and efficient routing management to not only ensure real-time updating of the menu data on the left side of the web page, but also keep the routing jump content area always up to date, ultimately providing users with an efficient, smooth and easy-to-use Web application environment.

[0012] Optionally, in one embodiment of the present application, after generating the final switching result of the web page menu, it also includes: obtaining the user's display requirements; generating a display instruction according to the user's display requirements, and displaying the corresponding page content in the content area of ​​the web page menu in response to the display instruction.

[0013] The embodiments of the present application can accurately obtain the user's display needs and generate display instructions accordingly, and finally realize the process of displaying the corresponding page content in the content area of ​​the web page menu, which can not only significantly improve the user experience, but also promote the efficient operation and development of Web applications.

[0014] Optionally, in one embodiment of the present application, after obtaining the user's system menu set and favorite menu data, it also includes: using a preset state management library to store the system menu set and the favorite menu data in a web page to obtain storage data; initializing the storage data to generate menu list data corresponding to the web page.

[0015] The embodiment of the present application can store and initialize system menu sets and favorite menu data, which can not only optimize the architectural design of front-end applications, but also significantly improve user experience and provide solid technical support for complex application scenarios.

[0016] The second aspect of the present application provides a web page menu switching device, including: an acquisition module, used to acquire a user's system menu set and favorite menu data; a judgment module, used to judge whether the browser address bar URL meets a preset monitoring condition based on the system menu set and the favorite menu data; a switching module, used to use a callback function to monitor the routing code in the browser address bar URL when the browser address bar URL meets the preset monitoring condition, generate a monitoring result, and execute at least one web page menu switching action according to the monitoring result to generate a final switching result of the web page menu.

[0017] Optionally, in one embodiment of the present application, the switching module includes: an updating unit, used to update the left menu list of the web page menu according to the monitoring result when the favorite menu button is clicked or the web page jumps to a page, so as to obtain an updated menu list; and a determining unit, used to determine the final switching result of the web page menu according to the updated menu list.

[0018] Optionally, in one embodiment of the present application, it also includes: a trigger module, which is used to trigger the browser to re-render using a responsive data mechanism after updating the left menu list of the web page menu according to the monitoring result, so as to generate updated web page left menu data; a generation module, which is used to update the route jump content area according to the updated web page left menu data, so as to generate a final route jump content area.

[0019] Optionally, in one embodiment of the present application, it also includes: a demand acquisition module, which is used to obtain the user's display demand after generating the final switching result of the web page menu; a display module, which is used to generate a display instruction according to the user's display demand, and display the corresponding page content in the content area of ​​the web page menu in response to the display instruction.

[0020] Optionally, in one embodiment of the present application, it also includes: a storage module, which is used to store the system menu set and the favorite menu data of the user in a web page by using a preset status management library after obtaining the system menu set and the favorite menu data, so as to obtain storage data; an initialization module, which is used to initialize the storage data to generate menu list data corresponding to the web page.

[0021] A third aspect of the present application provides a computer device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the web page menu switching method as described in the above embodiment.

[0022] A fourth aspect of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, which, when executed by a processor, implements the above web page menu switching method.

[0023] The embodiment of the present application monitors the URL change of the browser address bar to change the menu of different systems to realize the display switching of multiple system menus, realizes the high reuse of public components and public methods, and makes the code more maintainable. Only one set of server resources needs to be deployed to reduce the cost of server resources, and the resource request of the public part only needs to be requested once, which reduces the waste of user network resources. Thus, it solves the problems that the related technology cannot achieve real-time update of the left menu list, public components, public methods, etc. cannot reuse the later code, maintenance is difficult, and multiple systems need to be deployed, resulting in waste of resources.

[0024] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0026] Figure 1 A flowchart of a webpage menu switching method provided according to an embodiment of the present application;

[0027] Figure 2 A web page homepage layout diagram of a web page menu switching method according to an embodiment of the present application;

[0028] Figure 3 A menu corresponding to a system web page layout diagram of a web page menu switching method according to an embodiment of the present application;

[0029] Figure 4 A menu switching flow chart of a method for switching a webpage menu according to an embodiment of the present application;

[0030] Figure 5 A schematic diagram of the structure of a webpage menu switching device provided according to an embodiment of the present application;

[0031] Figure 6 It is a schematic diagram of the structure of a computer device provided according to an embodiment of the present application. DETAILED DESCRIPTION

[0032] Embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.

[0033] The following describes the webpage menu switching method, device, computer equipment and storage medium of the embodiment of the present application with reference to the accompanying drawings. In view of the problem that the related technology mentioned in the above background technology cannot achieve the real-time update of the left menu list, the public components, public methods, etc. cannot reuse the later code, maintenance is difficult, and multiple systems need to be deployed, resulting in a waste of resources, the present application provides a webpage menu switching method, in which the menus of different systems are replaced by monitoring the URL changes in the browser address bar to achieve the display switching of multiple system menus, and the public components and public methods are highly reused. The code is more maintainable, only one set of server resources needs to be deployed to reduce the cost of server resources, and the resource request of the public part only needs to be requested once, which reduces the waste of user network resources. Thus, the related technology cannot achieve the real-time update of the left menu list, the public components, public methods, etc. cannot reuse the later code, maintenance is difficult, and multiple systems need to be deployed, resulting in a waste of resources.

[0034] Specifically, Figure 1 A schematic diagram of a flow chart of a web page menu switching method provided in an embodiment of the present application.

[0035] like Figure 1 As shown, the webpage menu switching method includes the following steps:

[0036] In step S101, the user's system menu set and favorite menu data are obtained.

[0037] It can be understood that the system menu set and favorite menu data in the embodiment of the present application are a list of all functional modules or pages that a user can access in a specific application or website, as well as menu items that the user personally marks as commonly used or of particular interest.

[0038] In the actual implementation process, the embodiment of the present application can realize web page menu switching based on vue, vue-router, pinia, and axios. After the user logs in, axios calls the server to request to obtain all the user's system menu sets and the collection menu data of the user's homepage.

[0039] Among them, the technical structure includes four parts: front-end framework vue framework, vue-router, pinia management status library, and axios technology.

[0040] It should be noted that the vue framework in the embodiment of the present application is a progressive front-end framework for building user interfaces to complete the development of front-end pages, and is the front-end framework of the present application; the official router of vue is used to make routing jumps in a single-page system, and listens to and reads the routing code in the browser URL through its beforeEach hook to update the menu data list in pinia in real time; Pinia is a vue state management library that provides functions such as data storage. When introduced in a web page, it can cache data that needs to be stored in the web page, such as menu collection data; axios technology is an interactive communication technology between the web page and the server, through which it can query the commonly used menus collected by the current user and the system menu collection owned by the user.

[0041] The embodiment of the present application can obtain the user's system menu set and favorite menu data, which can not only achieve precise control of user permissions, but also provide users with a personalized user experience, while also helping to improve the design of the user interface to make it more in line with actual usage scenarios.

[0042] Optionally, in one embodiment of the present application, after obtaining the user's system menu set and favorite menu data, it also includes: using a preset state management library to store the system menu set and favorite menu data in a web page to obtain storage data; initializing the storage data to generate menu list data corresponding to the web page.

[0043] It can be understood that the preset state management library in the embodiment of the present application can be Pinia, where Pinia is a vue state management library.

[0044] In the actual execution process, the embodiment of the present application can call the initialization menu method of pinia after obtaining the user system menu set menuMap and the collection menu data collectList. Vue-router provides the method addCode to register the routing element and add the code attribute to the routing element path to identify which system the current route belongs to. The pinia initialization method calls the registration routing method addCode of vue-router, and then stores the menu collection data menuMap and the collection menu data collectList in the web page to obtain the stored data and initialize the stored data, that is, initialize the user's current menu list menuList to the menu list data corresponding to the home page to generate the menu list data corresponding to the web page, wherein the web page home page layout diagram is as follows Figure 2 As shown, the menu corresponds to the layout of the system web page as shown in Figure 3 shown.

[0045] The embodiment of the present application can store and initialize system menu sets and favorite menu data, which can not only optimize the architectural design of front-end applications, but also significantly improve user experience and provide solid technical support for complex application scenarios.

[0046] In step S102, based on the system menu set and the favorites menu data, it is determined whether the URL in the browser address bar meets the preset monitoring condition.

[0047] It can be understood that, in the embodiment of the present application, satisfying the preset monitoring condition may be satisfying the condition of monitoring and reading the code of the routing path in the browser URL.

[0048] During the actual execution process, the embodiment of the present application can determine whether the browser address bar URL meets certain monitoring conditions based on the system menu set and favorites menu data, and thus decide whether to perform a specific operation by monitoring the changes in the browser address bar URL and combining the user's system menu set and favorites menu data.

[0049] The embodiment of the present application can determine whether the URL in the browser address bar meets certain monitoring conditions, thereby providing support for subsequent monitoring, and then effectively managing and displaying complex menu structures, providing users with a more intuitive and efficient user experience.

[0050] It should be noted that the preset monitoring conditions can be set by those skilled in the art according to actual conditions and are not specifically limited here.

[0051] In step S103, if the browser address bar URL meets the preset monitoring condition, the callback function is used to monitor the routing code in the browser address bar URL, generate a monitoring result, and execute at least one web page menu switching action according to the monitoring result to generate a final switching result of the web page menu.

[0052] In the actual execution process, the embodiment of the present application triggers the beforeEach of vue-router before entering the page when the url in the browser address bar meets certain monitoring conditions, and reads the code of the routing path in the browser url in the callback function through the beforeEach monitoring to generate the monitoring result. The embodiment of the present application can provide a method changeMenuList in the action syntax of pinia to update the menuList data through the code, that is, call the changeMenuList method of pinia to update the menuList, execute the beforeEach callback function next, and execute at least one web page menu switching action according to the monitoring result to generate the final switching result of the web page menu.

[0053] The embodiment of the present application can ensure the effective processing of browser bookmark functions in web pages. When clicking on the commonly used bookmarked web page menu on the homepage of the web page, the content area displays the corresponding page content, and switches the menu list on the left side of the web page in real time, thereby realizing high reuse of public components and public methods, and making the code more maintainable. Only one set of server resources needs to be deployed to reduce the cost of server resources, and resource requests for the public part only need to be requested once, thereby reducing the waste of user network resources.

[0054] It should be noted that the preset monitoring conditions can be set by those skilled in the art according to actual conditions and are not specifically limited here.

[0055] Optionally, in one embodiment of the present application, at least one web page menu switching action is performed according to the monitoring results to generate a final switching result of the web page menu, including: when a favorite menu button is clicked or a web page jumps to a page, the left menu list of the web page menu is updated according to the monitoring results to obtain an updated menu list; and the final switching result of the web page menu is determined according to the updated menu list.

[0056] It can be understood that the monitoring result in the embodiment of the present application is the result of monitoring the routing code in the URL in the browser address bar.

[0057] Specifically, when a user clicks a favorites menu button in the system or a jump button in a page to jump to a page, the embodiment of the present application can trigger the beforeEach of vue-router to repeatedly execute the step of updating the left menu list of the web page menu according to the monitoring results, obtain the updated menu list, and determine the final switching result of the web page menu according to the updated menu list.

[0058] The embodiment of the present application can change the menus of different systems by monitoring the URL changes in the browser address bar to achieve switching of multiple system menu displays, further ensuring that resource requests for the public part only need to be requested once, reducing the waste of user network resources.

[0059] Optionally, in one embodiment of the present application, after updating the left menu list of the web page menu according to the monitoring results, it also includes: using a responsive data mechanism to trigger browser re-rendering to generate updated web page left menu data; updating the route jump content area according to the updated web page left menu data to generate the final route jump content area.

[0060] During the actual execution process, the embodiment of the present application can use menutList data to update vue responsive data to trigger browser re-rendering, generate updated menu data on the left side of the web page, and update the route jump content area according to the updated menu data on the left side of the web page to generate the final route jump content area.

[0061] The embodiment of the present application uses a responsive data mechanism and efficient routing management to not only ensure the real-time update of the menu data on the left side of the web page, but also keep the routing jump content area always up to date, ultimately providing users with an efficient, smooth and easy-to-use application environment.

[0062] Optionally, in one embodiment of the present application, after generating the final switching result of the web page menu, it also includes: obtaining the user's display requirements; generating display instructions according to the user's display requirements, and displaying the corresponding page content in the content area of ​​the web page menu in response to the display instructions.

[0063] It is understandable that the display needs in the embodiments of the present application can be analyzed by user keyword search, option selection, etc.

[0064] Among them, the embodiment of the present application can obtain the user's display needs, generate display instructions according to the user's display needs, and display the corresponding page content in the content area of ​​the web page menu in response to the display instructions, thereby ensuring that when the page jumps, the code monitored by the URL is called through the vue-router and pinia methods to realize real-time switching of different web page menu displays.

[0065] The embodiment of the present application can accurately obtain the user's display needs, and generate display instructions accordingly, and finally realize the process of displaying the corresponding page content in the content area of ​​the web page menu, which can significantly improve the user experience.

[0066] Specifically, it can be combined Figure 4 As shown, the working principle of the method for switching the webpage menu in the embodiment of the present application is described in detail with a specific embodiment.

[0067] like Figure 4 As shown, the embodiment of the present application may include the following steps:

[0068] Step S401: User logs in.

[0069] Step S402: Obtain the user system menu set menuMap and collection menu data collectList.

[0070] Step S403: pinia stores data, initializes routing code, and provides a method for updating menu data.

[0071] Step S404: wue-router.

[0072] Step S405: beforeEach obtains code and calls pinia method to update data.

[0073] Step S406: The user system clicks on the page to jump.

[0074] Step S407: The left menu is updated and the content page is displayed.

[0075] According to the webpage menu switching method proposed in the embodiment of the present application, the menus of different systems are changed by monitoring the URL changes in the browser address bar to realize the display switching of multiple system menus, and the high reuse code of public components and public methods is realized, which is more maintainable. Only one set of server resources needs to be deployed to reduce the cost of server resources, and the resource request of the public part only needs to be requested once, which reduces the waste of user network resources. Therefore, the problem that the related technology cannot achieve real-time update of the left menu list, public components, public methods, etc. cannot reuse the later code, maintenance is difficult, and multiple systems need to be deployed, resulting in waste of resources is solved.

[0076] Next, a webpage menu switching device according to an embodiment of the present application is described with reference to the accompanying drawings.

[0077] Figure 5 It is a structural schematic diagram of a webpage menu switching device according to an embodiment of the present application.

[0078] like Figure 5 As shown, the webpage menu switching device 10 includes: an acquisition module 100 , a determination module 200 and a switching module 300 .

[0079] Specifically, the acquisition module 100 is used to acquire the user's system menu set and favorite menu data.

[0080] The judgment module 200 is used to judge whether the URL in the browser address bar meets the preset monitoring condition based on the system menu set and the favorite menu data.

[0081] The switching module 300 is used to monitor the routing code in the browser address bar URL using a callback function when the browser address bar URL meets the preset monitoring condition, generate a monitoring result, and execute at least one web page menu switching action according to the monitoring result to generate a final switching result of the web page menu.

[0082] Optionally, in one embodiment of the present application, the switching module 300 includes: an updating unit and a determining unit.

[0083] The updating unit is used to update the left menu list of the webpage menu according to the monitoring result when the favorites menu button is clicked or the webpage jumps to another page, so as to obtain the updated menu list.

[0084] The determination unit is used to determine the final switching result of the webpage menu according to the updated menu list.

[0085] Optionally, in one embodiment of the present application, the webpage menu switching device 10 further includes: a trigger module and a generation module.

[0086] Among them, the trigger module is used to trigger the browser to re-render by using a responsive data mechanism after updating the left menu list of the web page menu according to the monitoring result, so as to generate updated web page left menu data.

[0087] The generation module is used to update the route jump content area according to the updated left menu data of the web page to generate the final route jump content area.

[0088] Optionally, in an embodiment of the present application, the webpage menu switching device 10 further includes: a demand acquisition module and a display module.

[0089] The demand acquisition module is used to acquire the user's display demand after generating the final switching result of the webpage menu.

[0090] The display module is used to generate a display instruction according to the user's display requirements, and in response to the display instruction, display the corresponding page content in the content area of ​​the webpage menu.

[0091] Optionally, in an embodiment of the present application, the webpage menu switching device 10 further includes: a storage module and an initialization module.

[0092] The storage module is used to store the system menu set and the favorite menu data in a web page by using a preset state management library after acquiring the system menu set and the favorite menu data of the user, so as to obtain the storage data.

[0093] The initialization module is used to initialize the stored data to generate the menu list data corresponding to the web page.

[0094] It should be noted that the above explanation of the webpage menu switching method embodiment is also applicable to the webpage menu switching device of this embodiment, and will not be repeated here.

[0095] According to the webpage menu switching device proposed in the embodiment of the present application, the menus of different systems are changed by monitoring the URL changes in the browser address bar to realize the display switching of multiple system menus, and the high reuse code of public components and public methods is realized, which is more maintainable. Only one set of server resources needs to be deployed to reduce the cost of server resources, and the resource request of the public part only needs to be requested once, which reduces the waste of user network resources. Therefore, the problem that the related technology cannot achieve real-time update of the left menu list, public components, public methods, etc. cannot reuse the later code, maintenance is difficult, and multiple systems need to be deployed, resulting in waste of resources is solved.

[0096] Figure 6A schematic diagram of the structure of a computer device provided in an embodiment of the present application. The computer device may include:

[0097] A memory 601 , a processor 602 , and a computer program stored in the memory 601 and executable on the processor 602 .

[0098] When the processor 602 executes the program, the webpage menu switching method provided in the above embodiment is implemented.

[0099] Furthermore, the computer device also includes:

[0100] The communication interface 603 is used for communication between the memory 601 and the processor 602 .

[0101] The memory 601 is used to store computer programs that can be executed on the processor 602 .

[0102] The memory 601 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0103] If the memory 601, the processor 602 and the communication interface 603 are implemented independently, the communication interface 603, the memory 601 and the processor 602 can be connected to each other through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0104] Optionally, in a specific implementation, if the memory 601, the processor 602 and the communication interface 603 are integrated on a chip, the memory 601, the processor 602 and the communication interface 603 can communicate with each other through an internal interface.

[0105] The processor 602 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.

[0106] This embodiment further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the method for switching a webpage menu as described above is implemented.

[0107] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0108] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0109] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or N executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.

[0110] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or N wirings (electronic devices), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways as necessary and then storing it in a computer memory.

[0111] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiment, the N steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0112] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0113] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0114] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present application. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present application.

Claims

1. A method for switching a webpage menu, characterized in that: The following steps are involved: Get the user's system menu collection and favorite menu data; Based on the system menu set and the favorites menu data, determine whether the URL in the browser address bar meets the preset monitoring condition; If the browser address bar url meets the preset monitoring condition, the callback function is used to monitor the routing code in the browser address bar url, generate a monitoring result, and execute at least one web page menu switching action according to the monitoring result to generate a final switching result of the web page menu.

2. The method according to claim 1, characterized in that The performing at least one webpage menu switching action according to the monitoring result to generate a final switching result of the webpage menu includes: When the favorites menu button is clicked or the web page jumps to another page, the left menu list of the web page menu is updated according to the monitoring result to obtain an updated menu list; The final switching result of the webpage menu is determined according to the updated menu list.

3. The method according to claim 2, characterized in that After updating the left menu list of the webpage menu according to the monitoring result, the method further includes: Use the responsive data mechanism to trigger browser re-rendering to generate updated web page left menu data; The route jump content area is updated according to the updated left menu data of the webpage to generate a final route jump content area.

4. The method according to claim 1, characterized in that: After generating the final switching result of the web page menu, it also includes: Obtain the user's display needs; A display instruction is generated according to the display demand of the user, and in response to the display instruction, corresponding page content is displayed in the content area of ​​the webpage menu.

5. The method according to claim 1, characterized in that After obtaining the user's system menu collection and favorite menu data, it also includes: Using a preset state management library, the system menu set and the favorite menu data are stored in a web page to obtain storage data; Initialize the stored data to generate menu list data corresponding to the web page.

6. A webpage menu switching device, characterized in that: include: The acquisition module is used to obtain the user's system menu set and favorite menu data; A judgment module, used to judge whether the URL in the browser address bar meets the preset monitoring condition based on the system menu set and the favorites menu data; The switching module is used to use a callback function to monitor the routing code in the browser address bar URL when the browser address bar URL meets the preset monitoring condition, generate a monitoring result, and execute at least one web page menu switching action according to the monitoring result to generate a final switching result of the web page menu.

7. The device according to claim 6, characterized in that The switching module comprises: An updating unit, configured to update the left menu list of the webpage menu according to the monitoring result to obtain an updated menu list when the favorites menu button is clicked or the webpage jumps to another page; A determining unit is used to determine a final switching result of the webpage menu according to the updated menu list.

8. The device according to claim 7, characterized in that Also includes: A trigger module, for triggering the browser to re-render by using a responsive data mechanism after updating the left menu list of the webpage menu according to the monitoring result, so as to generate updated left menu data of the webpage; The generating module is used to update the route jump content area according to the updated left menu data of the webpage to generate a final route jump content area.

9. A computer device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the webpage menu switching method according to any one of claims 1 to 5.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: The program is executed by a processor to implement the webpage menu switching method as described in any one of claims 1 to 5.