返回介绍

Ionic4 单选框组件 ion-radio-group

发布于 2019-11-22 18:04:18 字数 3205 浏览 1203 评论 0 收藏 0

Ionic4项目中我们可以使用Ionic4单选框组件ion-radio-group对项目进行布局。

ion-radio-group官方文档地址:https://ionicframework.com/docs/api/radio-group

A radio group is a group of radio buttons. It allows a user to select at most one radio button from a set. Checking one radio button that belongs to a radio group unchecks any previous checked radio button within the same group.

ion-radio-group 用法(Usage)


  
    
      Auto Manufacturers
    

    
      Cord
      
    

    
      Duesenberg
      
    

    
      Hudson
      
    

    
      Packard
      
    

    
      Studebaker
      
    
  
</ion-list>

  
    
      Auto Manufacturers
    

    
      Cord
      
    

    
      Duesenberg
      
    

    
      Hudson
      
    

    
      Packard
      
    

    
      Studebaker
      
    
  
</ion-list>
import React from 'react';

import { IonList, IonRadioGroup, IonListHeader, IonLabel, IonRadio, IonItem } from '@ionic/react';

const Example: React.SFC = () => (

  
    
      
        Auto Manufacturers
      

      
        Cord
        
      

      
        Duesenberg
        
      

      
        Hudson
        
      

      
        Packard
        
      

      
        Studebaker
        
      
    
  
);

export default Example

  
    
      
        Auto Manufacturers
      

      
        Cord
        
      

      
        Duesenberg
        
      

      
        Hudson
        
      

      
        Packard
        
      

      
        Studebaker
        
      
    
  
</template>

ion-radio-group 属性(Properties)

allowEmptySelection

Description

If true, the radios can be deselected.

Attributeallow-empty-selection
Typeboolean
Defaultfalse

name

Description

The name of the control, which is submitted with the form data.

Attributename
Typestring
Defaultthis.inputId

value

Description

the value of the radio group.

Attributevalue
Typeany

ion-radio-group 事件(Events)

NameDescription
ionChangeEmitted when the value has changed.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文