npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ozo/radio

v1.0.3

Published

单选列表for移动端

Readme

单选列表(移动端)

@ozo/radio

单选列表for移动端

Radio 组件用法

Radio 组件包括 RadioGroup、Radio 两个子组件,需要配合使用。

RadioGroup 具有三个属性

  • name:必须,RadioGroup 的 name,用于对 Radio 进行分组
  • selectedValue:必须,RadioGroup 数据回填的对应字段
  • onChange:RadioGroup 值变化是触发的函数

Radio 具有两个属性

  • value:必须,按钮选中所对应的值
  • disabled:按钮是否禁用

用法

  1. 在需要引用 Radio 的页面或组件中引入组件
import { RadioGroup, Radio } from "../../components/Radio";
  1. 在需要引用 Radio 的页面或组件中添加状态:
this.state = {
    selectedValue : 'React'
}

mobx 等状态管理放到对应的 store

  1. 在需要引用 Radio 的页面或组件中添加选中 Radio 子项后的回调方法
handleChange(value, index, event){
    console.log('change');
    console.log(value);
    this.setState({selectedValue:value});
}
  1. jsx 部分引入以下结构
<RadioGroup name="platform" selectedValue={this.state.selectedValue} onChange={this.handleChange}}>
    <Radio value="1" disabled="true">React</Radio>
    <Radio value="2">VUE</Radio>
    <Radio value="3">jQuery</Radio>
</RadioGroup>

Radio 组件的位置可以不是直接子元素。

API

| 参数名 | 说明 | 必填 | 类型 | 默认值 | 备注 | | ------ | ---- | ---- | ---- | ------ | ---- | | | | | | | |