baidu / amis

前端低代码框架,通过 JSON 配置就能生成各种页面。
https://baidu.github.io/amis/
Apache License 2.0
17.44k stars 2.53k forks source link

锚点导航-默认三个锚点,点击第二个锚点标题不跳转 #10975

Open duyuanyuan0815 opened 2 months ago

duyuanyuan0815 commented 2 months ago

描述问题:

锚点导航--默认三个锚点,点击第二个锚点标题不跳转

截图或视频:

可以的话,尽可能提供截图或视频来补充描述你的问题...

如何复现(请务必完整填写下面内容):

  1. 你是如何使用 amis 的? sdk

  2. amis 是最新版本

  3. 粘贴有问题的完整 amis schema 代码:

    {
    "type": "anchor-nav",
    "links": [
    {
      "title": "锚点1",
      "href": "1",
      "body": [
        {
          "type": "tpl",
          "tpl": "这里是锚点内容1",
          "wrapperComponent": "",
          "inline": false,
          "id": "u:08d55d56cbe0"
        },
        {
          "type": "input-text",
          "label": "文本",
          "name": "text",
          "id": "u:8ecedd3ce2f8"
        },
        {
          "type": "input-text",
          "label": "文本",
          "name": "text",
          "id": "u:d70953531120"
        },
        {
          "type": "input-text",
          "label": "文本",
          "name": "text",
          "id": "u:c265fcab5854"
        },
        {
          "type": "input-text",
          "label": "文本",
          "name": "text",
          "id": "u:83f5f72d2c5f"
        },
        {
          "type": "input-text",
          "label": "文本",
          "name": "text",
          "id": "u:6d28ff35ec3e"
        },
        {
          "type": "input-text",
          "label": "文本",
          "name": "text",
          "id": "u:59044581cba2"
        },
        {
          "type": "input-text",
          "label": "文本",
          "name": "text",
          "id": "u:2da8f245c145"
        },
        {
          "type": "input-text",
          "label": "文本",
          "name": "text",
          "id": "u:fbdd185862cf"
        }
      ],
      "id": "u:64202a07d9e7"
    },
    {
      "title": "锚点2",
      "href": "2",
      "body": [
        {
          "type": "tpl",
          "tpl": "这里是锚点内容2",
          "wrapperComponent": "",
          "inline": false,
          "id": "u:abfcf6ae7c63"
        },
        {
          "type": "calendar",
          "id": "u:19a7c94db2ec"
        },
        {
          "type": "calendar",
          "id": "u:94640916c4e3"
        },
        {
          "type": "calendar",
          "id": "u:b09a9f7805b5"
        },
        {
          "type": "calendar",
          "id": "u:241354b7f2d3"
        }
      ],
      "id": "u:8db05f4c4a6a"
    },
    {
      "title": "锚点3",
      "href": "3",
      "body": [
        {
          "type": "tpl",
          "tpl": "这里是锚点内容3",
          "wrapperComponent": "",
          "inline": false,
          "id": "u:2dd1623b848b"
        },
        {
          "type": "pdf-viewer",
          "id": "u:7d6e0131057d"
        },
        {
          "type": "markdown",
          "value": "## 这是标题",
          "id": "u:3a55e6840fdb"
        },
        {
          "type": "office-viewer",
          "id": "u:42f32873eb3d"
        },
        {
          "type": "office-viewer",
          "id": "u:830b8a2f8015"
        },
        {
          "type": "office-viewer",
          "id": "u:80a7adbc3899"
        },
        {
          "type": "office-viewer",
          "id": "u:2a70cc38a42b",
          "wordOptions": {}
        }
      ],
      "id": "u:fd8f61d561b8"
    }
    ],
    "id": "u:0f461b77617b",
    "active": "1",
    "direction": "vertical"
    }
  4. 操作步骤 页面中添加锚点导航组件,为每个锚点内容区添加内容。预览时点击第二个锚点标题无反应,点击第三个锚点标题可以跳转。