harmony 鸿蒙“js” Tag

  • 2023-06-24
  • 浏览 (453)

“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”.

NOTE

The “name” and “pages” tags are configured in the “js” tag of the config.json file.

pages

The “pages” defines the route information of each page. Each page consists of the page path and page name. The following is an example:

{
  ...
  "pages": [
    "pages/index/index",
    "pages/detail/detail"
  ]
  ...
}

NOTE

  • 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": [
      {
        ...
      }
    ]
  }
}

你可能感兴趣的鸿蒙文章

harmony 鸿蒙JavaScript-compatible Web-like Development Paradigm (ArkUI.Lite)

harmony 鸿蒙Universal Attributes

harmony 鸿蒙Universal Events

harmony 鸿蒙Universal Styles

harmony 鸿蒙chart

harmony 鸿蒙image-animator

harmony 鸿蒙image

harmony 鸿蒙input

harmony 鸿蒙marquee

harmony 鸿蒙picker-view

0  赞