目录

"js" Tag

The "js" tag contains the instance name and page route information.

Tag Type Default Value Mandatory Description
name string default Yes Name of the JavaScript instance.
pages Array - Yes Route information. For details, see "pages".

The "name" and "pages" tags are configured in the "js" tag of the configuration file.

"pages"

Defines the route information of each page. Each page consists of the page path and page name. The page file name is the page name. For example:

{
  // ...
  "pages": [
    "pages/index/index",
    "pages/detail/detail"
  ]
  // ...
}
  • The application home page is fixed to pages/index/index.

  • The page name should not be a component name, for example, text.hml or button.hml.

Example

{
  "app": {
    "bundleName": "com.example.player",
    "version": {
        "code": 1,
        "name": "1.0"
    },
    "vendor": "example"
  },
  "module": {
    // ...
    "js": [
      {
        "name": "default",
        "pages": [
          "pages/index/index",
          "pages/detail/detail"
        ]
      }
    ],
    "abilities": [
      {
        // ...
      }
    ]
  }
}