javascript - 如何使用 React/Ionic 设置活动的 IonicSegmentButton?
问题描述
我正在尝试将特定的细分按钮设置为活动状态,并且我一直在寻找如何做到这一点。Angular/Ionic 似乎有可能,但我正在使用 React 并且无法找到 React 的答案。
这是代码:
<IonItem>
<IonText>Status<IonText color="danger">*</IonText></IonText>
<IonSegment id="event_status">
<IonSegmentButton value="close">
<IonLabel>Close</IonLabel>
</IonSegmentButton>
<IonSegmentButton value="open">
<IonLabel>Open</IonLabel>
</IonSegmentButton>
</IonSegment>
</IonItem>
我想将关闭按钮设置为活动按钮
解决方案
因为它对您有用,所以其他人也可以得到帮助:
尝试在主<IonSegment id="event_status" value="close">
标签上设置值。
希望它会起作用
推荐阅读
- visual-studio-code - 始终运行特定文件,而不是 VS 代码中的当前文件
- javascript - 如何根据所说的内容使机器人不发送多个响应(Discord.js)
- python - {FieldError}TimeField 的不支持查找“时间”或不允许加入该字段
- c++ - 以下 3 种定义对象的方法是否相同?
- transparency - obj 的 mtl 文件中的透明 png(alpha 通道)支持
- c# - 从 html.actionlink 在外部页面上调用 jQuery 函数
- flask - Flask JWT GraphQL - 设置访问/刷新 cookie
- google-cloud-platform - GCP 删除计算引擎 - 虚拟机实例 - 不启用结算
- php - DDD - 如何管理聚合之间的共享实体?
- python - 创建一个可以接受邮递员请求的python服务器