Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

数据刷新,nav组件activeON 不重新计算,无法高亮 #9481

Closed
AprildreamMI opened this issue Jan 20, 2024 · 2 comments · Fixed by #9829
Closed

数据刷新,nav组件activeON 不重新计算,无法高亮 #9481

AprildreamMI opened this issue Jan 20, 2024 · 2 comments · Fixed by #9829
Assignees
Labels
doc optimizing document need confirm

Comments

@AprildreamMI
Copy link

描述问题:

数据刷新,nav组件activeON 不重新计算,无法高亮

截图或视频:

image

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

  1. 你是如何使用 amis 的?
    npm ,react

  2. amis 版本是什么?请先在最新 beta 版本测试问题是否存在
    6.0.0

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

{
    "type": "page",
    "id": "pageId",
    "name": "layout_page",
    "body": [
        {
            "type": "button",
            "label": "第一个",
            "level": "primary",
            "className": "mb-2",
            "onEvent": {
                "click": {
                    "actions": [
                        {
                            "actionType": "setValue",
                            "componentName": "layout_page",
                            "args": {
                                "value": {
                                    "activeKey": "/docs/index"
                                }
                            }
                        }
                    ]
                }
            }
        },
        {
            "type": "button",
            "label": "第二个",
            "level": "primary",
            "className": "mb-2",
            "onEvent": {
                "click": {
                    "actions": [
                        {
                            "actionType": "setValue",
                            "componentId": "pageId",
                            "args": {
                                "value": {
                                    "activeKey": "/docs/renderers"
                                }
                            }
                        }
                    ]
                }
            }
        },
        {
            "type": "nav",
            "stacked": true,
            "className": "w-md",
            "links": [
                {
                    "label": "${activeKey}"
                },
                {
                    "label": "Nav 1",
                    "to": "/docs/index",
                    "activeOn": "${activeKey === '/docs/index'}"
                },
                {
                    "label": "Nav 2",
                    "to": "/docs/renderers",
                    "activeOn": "${activeKey === '/docs/renderers'}"
                }
            ]
        }
    ]
}
  1. 操作步骤
    点击按钮,更新page数据域的activeKey变量,不触发activeOn表达式计算,
Copy link

👍 Thanks for this!
🏷 I have applied any labels matching special text in your issue.

Please review the labels and make any necessary changes.

@github-actions github-actions bot added the doc optimizing document label Jan 20, 2024
@chenershisi
Copy link

same issue,anyone solved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc optimizing document need confirm
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants