• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2025 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15import { TabBarItemInterface } from './TabBarItemInterface';
16
17/**
18 * 构建一个Tab项所需要的信息
19 *
20 */
21export class TabInfo {
22  // tab项标题(页签内容)
23  public title: string;
24  // tab项内容
25  public contentBuilder: WrappedBuilder<[ESObject]>;
26  // tabBar(页签样式)
27  public barBuilder?: WrappedBuilder<[TabBarItemInterface]>;
28  // tabBarIndex
29  public params?: ESObject;
30
31  /**
32   * TabInfo构造器
33   * @param title - tab项标题
34   * @param contentBuilder - tab项内容
35   * @param barBuilder - tabBar
36   */
37  constructor(title: string, contentBuilder: WrappedBuilder<[ESObject]>,
38    barBuilder?: WrappedBuilder<[TabBarItemInterface]>, params?: ESObject) {
39    this.title = title;
40    this.contentBuilder = contentBuilder;
41    this.barBuilder = barBuilder;
42    this.params = params;
43  }
44}