amis icon indicating copy to clipboard operation
amis copied to clipboard

新手帮忙给看一下如何隐藏按钮?点击button1隐藏button2

Open wangjingyangmaster opened this issue 6 years ago • 4 comments

                                                {
                                                    "type": "button-group", // 按钮组
                                                    "buttons": [
                                                        {
                                                            "type": "button", // 点击此按钮隐藏button2
                                                            "label": "button1", 
                                                            "actionType": "reload",
                                                            "reload": 'button.html?varName=true', // 这行配置是否正确?? 
                                                            "target": "button2"
                                                        },
                                                        {
                                                            "type": "button", // button2(被隐藏的按钮)
                                                            "label": "button2",
                                                            "name": "button2",
                                                            "actionType": "dialog",
                                                            "dialog": {
                                                                "title": "系统提示",
                                                                "body": "对你点击了"
                                                            },
                                                            "visibleOn": "!this.varName"
                                                        }
                                                    ]
                                                }

wangjingyangmaster avatar Jul 29 '20 01:07 wangjingyangmaster

reload 是目标组件,比如,你给 page 设置个 name 为 'button.html'

2betop avatar Jul 29 '20 01:07 2betop

再装是目标组件,比如,你给页设置个姓名为“button.html”

大佬, 新版的手册, 会到哪月份发布呢, 好期待.

ghost avatar Jul 29 '20 02:07 ghost

快了快了

RickCole21 avatar Jul 29 '20 02:07 RickCole21

                                            {
                                                "type": "button-group", // 按钮组
                                                "buttons": [
                                                    {
                                                        "type": "button", // 点击此按钮隐藏button2
                                                        "label": "button1", 
                                                        "actionType": "reload",
                                                        "reload": 'button2?varName=true', // 这行配置是否正确?? 
                                                        "target": "button2"
                                                    },
                                                    {
                                                        "type": "button", // button2(被隐藏的按钮)
                                                        "label": "button2",
                                                        "name": "button2",
                                                        "actionType": "dialog",
                                                        "dialog": {
                                                            "title": "系统提示",
                                                            "body": "对你点击了"
                                                        },
                                                        "visibleOn": "!this.varName"
                                                    }
                                                ]
                                            }

是这么写吗?不好用啊

DragonBowers avatar Jul 30 '20 08:07 DragonBowers