import { Picker } from '@ray-js/ray'; 选择器组件不生效
Picker选择器组件不生效
-
- Posts: 22
Re: Picker选择器组件不生效
按以下demo试试呢,提供一下@ray-js/ray版本
Code: Select all
import React from 'react';
import { View, Picker } from '@ray-js/ray';
export default function Demo() {
const [current, setCurrent] = React.useState(0);
const handlePickerChange = (e) => {
setCurrent(+e.value);
};
const range = ['美国', '中国', '巴西', '日本'];
return (
<Picker
mode="selector"
onChange={handlePickerChange}
range={range}
value={current}
>
<View style={{ flexDirection: 'row' }}>
当前选择的是:{range[current]}
</View>
</Picker>
);
}
-
- Posts: 22
Re: Picker选择器组件不生效
提供的demo也不行,"@ray-js/ray": "1.4.45",我这个是智能小程序上的