Search

CN-122018749-A - Multi-view tab processing method, device, medium and product

CN122018749ACN 122018749 ACN122018749 ACN 122018749ACN-122018749-A

Abstract

The application discloses a method, a device, a medium and a product for processing tabs under multiple views, and relates to the technical field of multi-view content switching. The method comprises the steps of determining view item list data and tab data lists, configuring corresponding first identifiers for each view item object in the view item list data, configuring second identifiers for each tab in the tab data list, constructing a key value storage structure according to the view item list data and the tab data lists, enabling keys in the key value storage structure to be the first identifiers, enabling values to be the second identifiers of currently selected tabs corresponding to view items, and determining the tabs corresponding to the currently selected view items based on the key value storage structure in a view rendering process. The scheme of the application solves the problem of state management redundancy in the multi-view content switching prevention in the prior art.

Inventors

  • RUAN JUNJIE
  • HUANG HUAXIN
  • Zou Weizheng
  • YU DAIYUAN
  • XUE RONGRONG

Assignees

  • 中移动信息技术有限公司
  • 中国移动通信集团有限公司

Dates

Publication Date
20260512
Application Date
20260203

Claims (10)

  1. 1. A method for processing a tab in multiple views, comprising: Determining view item list data and a tab data list, wherein each view item object in the view item list data is configured with a corresponding first identifier; Constructing a key value storage structure according to the view item list data and the tab data list, wherein keys in the key value storage structure are the first identifiers and the values are the second identifiers of the tabs currently selected by the corresponding view items; And in the view rendering process, determining the tab corresponding to the currently selected view item based on the key value storage structure.
  2. 2. The method of claim 1, wherein determining, during view rendering, a tab corresponding to a currently selected view item based on the key-value storage structure comprises: Judging whether the third identifier of the view item associated with the content to be displayed is consistent with the first identifier of the current view item; If the current view item is consistent with the current view item, inquiring the key value storage structure based on the first identifier of the current view item, and acquiring a second identifier of the current tab corresponding to the current view item; Comparing the queried second identifier of the current tab with a fourth identifier of a target tab associated with the content to be displayed; and if the comparison results are consistent, displaying the option content corresponding to the target tab.
  3. 3. The method of claim 1, wherein, in the view rendering process, after determining the tab corresponding to the currently selected view item based on the key value storage structure, the method further comprises: After the view list rendering is completed, assigning a second identifier corresponding to each tab in the tab data list to an option display attribute of each view item; inquiring a target identifier corresponding to the first identifier from the key value storage structure according to the option display attribute and the first identifier of the current view item; And assigning the target identifier to the selected state attribute of the current view item so that the target option corresponding to the target identifier presents the selected state.
  4. 4. The method of claim 1, wherein, in the view rendering process, after determining the tab corresponding to the currently selected view item based on the key value storage structure, the method further comprises: Monitoring an option switching event of the view item, wherein the option switching event comprises a switching target; When the option switching event is triggered, a first target identifier of a view item of the switching target and a second target identifier of a tab of the switching target are acquired through an event callback; and replacing a second identifier associated with the current view item in the key value storage structure with the second target identifier according to the first target identifier and the second target identifier.
  5. 5. The method of claim 1, wherein the number of items of option content configured in the view item object corresponds to the number of options in the tab data list.
  6. 6. The method according to claim 2, wherein the data of the option content is stored in an index through a second identifier of the tab, and the corresponding content data is directly retrieved for display by using the second identifier after the second identifiers are aligned and consistent.
  7. 7. A multi-view tab processing apparatus, comprising: The system comprises a first determining module, a second determining module and a second determining module, wherein the first determining module is used for determining view item list data and a tab data list, each view item object in the view item list data is configured with a corresponding first identifier, and each tab in the tab data list is configured with a second identifier; the first processing module is used for constructing a key value storage structure according to the view item list data and the tab data list, wherein keys in the key value storage structure are the first identifiers, and the values are the second identifiers of the tabs currently selected by the corresponding view items; and the second processing module is used for determining the tab corresponding to the currently selected view item based on the key value storage structure in the view rendering process.
  8. 8. The apparatus according to claim 7, wherein the second processing module is specifically configured to: Judging whether the third identifier of the view item associated with the content to be displayed is consistent with the first identifier of the current view item; If the current view item is consistent with the current view item, inquiring the key value storage structure based on the first identifier of the current view item, and acquiring a second identifier of the current tab corresponding to the current view item; Comparing the queried second identifier of the current tab with a fourth identifier of a target tab associated with the content to be displayed; and if the comparison results are consistent, displaying the option content corresponding to the target tab.
  9. 9. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, implements the steps of the method according to any one of claims 1 to 6.
  10. 10. A computer program product comprising computer instructions which, when executed by a processor, implement the steps of the method of any of claims 1 to 6.

Description

Multi-view tab processing method, device, medium and product Technical Field The application relates to the technical field of multi-view content switching, in particular to a multi-view tab processing method, a multi-view tab processing device, a multi-view tab processing medium and a multi-view tab processing product. Background In the existing front-end page development process, the existing scheme widely adopts a Tab (Tab) component multiplexing mechanism to realize parallel view item rendering. When a plurality of parallel view items are generated in a mode of circulating data, each view item realizes switching of display contents by multiplexing the Tab component. The existing switching scheme has the following problems that when the number of Tabs is large, parameter values to be set become large, logics for judging different parameters in a calling method become complex, a large number of redundant codes are caused, subsequent expansion is not facilitated, in the prior art, a newly added Tab needs to synchronously implement independent logic implementation of content display hiding, so that state management redundancy is obviously increased, and engineering maintainability in a multi-view scene is affected. Disclosure of Invention At least one embodiment of the application provides a multi-view tab processing method, device, medium and product, which are used for solving the problem of state management redundancy in multi-view content switching prevention in the prior art. In order to solve the technical problems, the application is realized as follows: in a first aspect, an embodiment of the present application provides a method for processing a tab in multiple views, including: Determining view item list data and a tab data list, wherein each view item object in the view item list data is configured with a corresponding first identifier; Constructing a key value storage structure according to the view item list data and the tab data list, wherein keys in the key value storage structure are the first identifiers and the values are the second identifiers of the tabs currently selected by the corresponding view items; And in the view rendering process, determining the tab corresponding to the currently selected view item based on the key value storage structure. Optionally, in the view rendering process, determining, based on the key value storage structure, a tab corresponding to the currently selected view item includes: Judging whether the third identifier of the view item associated with the content to be displayed is consistent with the first identifier of the current view item; If the current view item is consistent with the current view item, inquiring the key value storage structure based on the first identifier of the current view item, and acquiring a second identifier of the current tab corresponding to the current view item; Comparing the queried second identifier of the current tab with a fourth identifier of a target tab associated with the content to be displayed; and if the comparison results are consistent, displaying the option content corresponding to the target tab. Optionally, in the view rendering process, after determining the tab corresponding to the currently selected view item based on the key value storage structure, the method further includes: After the view list rendering is completed, assigning a second identifier corresponding to each tab in the tab data list to an option display attribute of each view item; inquiring a target identifier corresponding to the first identifier from the key value storage structure according to the option display attribute and the first identifier of the current view item; And assigning the target identifier to the selected state attribute of the current view item so that the target option corresponding to the target identifier presents the selected state. Optionally, in the view rendering process, after determining the tab corresponding to the currently selected view item based on the key value storage structure, the method further includes: Monitoring an option switching event of the view item, wherein the option switching event comprises a switching target; When the option switching event is triggered, a first target identifier of a view item of the switching target and a second target identifier of a tab of the switching target are acquired through an event callback; and replacing a second identifier associated with the current view item in the key value storage structure with the second target identifier according to the first target identifier and the second target identifier. Optionally, the number of the option content items configured in the view item object is consistent with the number of options in the tab data list. Optionally, the data of the option content is stored in an index through a second identifier of the tab, and after the second identifiers are compared and consistent, the corresponding content data is directly retr