目录

@cross-device-app-dev/sidebar-navigation

For 2-in-1 and tablet devices, the Tabs component should be set as a side navigation bar.

Rule Configuration

// code-linter.json5
{
  "rules": {
    "@cross-device-app-dev/sidebar-navigation": "warn"
  }
}

Options

This rule is not configurable.

Example of Correct Code

@Entry
@Component
struct Index {
  build() {
    Tabs() {
      TabContent() {
      }.tabBar("tab1")

      TabContent() {
      }.tabBar("tab2")
    }.vertical(true)
  }
}

Example of Incorrect Code

@Entry
@Component
struct Index {
  build() {
    Tabs() {
      TabContent() {
      }.tabBar("tab1")

      TabContent() {
      }.tabBar("tab2")
    }
  }
}

Rule Set

plugin:@cross-device-app-dev/recommended
plugin:@cross-device-app-dev/all

For details about how to configure Code Linter check rules, see Code Linter.