react-component / m-cascader Goto Github PK
View Code? Open in Web Editor NEWReact Mobile Cascader Component(web and react-native)
Home Page: http://react-component.github.io/m-cascader/
React Mobile Cascader Component(web and react-native)
Home Page: http://react-component.github.io/m-cascader/
我在reactjs中安装完后,导入报错如下:Uncaught Error: Cannot find module 'rmc-cascader',提示找不到这个模块
const data = [
{
label: '北京',
value: '01',
children: [
{
label: '东城区',
value: '01-1',
},
{
label: '西城区',
value: '01-2',
}
],
},
{
label: '浙江',
value: '02',
children: [
{
label: '杭州',
value: '02-1',
children: [
{
label: '西湖区',
value: '02-1-1',
}
],
},
{
label: '宁波',
value: '02-2',
children: [
{
label: 'xx区',
value: '02-2-1',
},
{
label: 'yy区',
value: '02-2-2',
},
],
}
],
},
];
class Demo extends React.Component<any, any> {
render() {
return (
<Cascader
data={data}
value={undefined}
rootNativeProps={{ 'data-xx': 'yy' }}
/>
);
}
}
As the example above, Cascader
component has no cascade effect when value
is undefined
点击出现浮层,不改变选项,点击确定,得不到当前选中的value。
onOk = () => { const {value, cols, data} = this.props; // console.log('inner onOk', this.state.pickerValue); this.props.onChange(getDefaultValue(data, this.state.pickerValue || value, cols).filter(c => !!c)); };
有个问题,如果刚好 this.state.pickerValue 为0时,!!c 为false;
为'0'时,则为true;
我是从antd-mobile跟踪到这里来的。
使用Picker的时候,如果data = [{value:0,label:'someThing'}]
选择第0个时,外面的picker仍然会显示“请选择”,而不是someThing。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.