nativeScript-radiobutton
一个用于暴露 radiogroup 和 radiobutton 原生视图元素的 nativescript 插件。
npm i --save nativescript-radiobutton
- 版本:0.1.0
- GitHub: https://github.com/Tunaweza/nativescript-radiobutton
- NPM: https://npmjs.net.cn/package/nativescript-radiobutton
- 下载
- 昨天: 0
- 上周: 0
- 上个月: 0
NativeScript-RadioButton
一个用于原生 radiogroup 和 radiobutton 小部件的 NativeScript 插件。
使用的平台控件
Android | iOS |
---|---|
Android RadioGroup | 无 |
Android RadioButton | 无 |
安装
从您的命令提示符/终端转到您的应用程序根文件夹,然后执行
tns plugin add nativescript-radiobutton
用法
Angular
导入 NgModule 以使用
import { RadioButtonModule } from 'nativescript-radiobutton/angular'
@NgModule({
imports: [
RadioButtonModule
]
})
将此放入您的视图中。
<StackLayout>
<RadioGroup [(value)]="dataBoundVariable">
<RadioButton text="Selection 1"></RadioButton>
<RadioButton text="Selection 2"></RadioButton>
<RadioButton text="Selection 3"></RadioButton>
</RadioGroup>
</StackLayout>
支持属性
###RadioButton
Android | 示例 |
---|---|
enabled | enabled="true | false" |
text | text="一个字符串" |
checked | checked="true | false" |
###RadioGroup
Android | 返回 |
---|---|
value | 所选单选按钮的索引 |
支持的事件
###RadioButton
Android | 示例 |
---|---|
enabled | enabled="true | false" |
text | text="一个字符串" |
checked | checked="true | false" |
###RadioGroup
Android | 类型 |
---|---|
value | EventEmitter |