We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@nutui/nutui
4.3.12
h5
https://nutui.jd.com/h5/vue/4x/#/zh-CN/component/picker
默认选中项 通过设置 v-model 实现默认选中项,v-model 是一个包含每项配置 value 值的数组。 <nut-picker v-model="val" :columns="columns" :title="String(val)" @confirm="confirm" />
没有设置默认值应该不选中
默认选中了第一个
No response
The text was updated successfully, but these errors were encountered:
No branches or pull requests
NutUI 包名
@nutui/nutui
NutUI 版本号
4.3.12
平台
h5
重现链接
https://nutui.jd.com/h5/vue/4x/#/zh-CN/component/picker
重现步骤
默认选中项
<script setup> import { ref } from 'vue' const val = ref() const columns = ref([ { text: '南京', value: 'Nanjing' }, { text: '无锡', value: 'Wuxi' }, { text: '海北', value: 'Haibei' }, { text: '北京', value: 'Beijing' }, { text: '连云港', value: 'Lianyungang' }, { text: '长沙', value: 'Changsha' }, { text: '武汉', value: 'Wuhan' } ]) const confirm = ({ selectedValue, selectedOptions }) => { console.log(selectedValue[0], selectedOptions[0]) } </script>通过设置 v-model 实现默认选中项,v-model 是一个包含每项配置 value 值的数组。
<nut-picker v-model="val" :columns="columns" :title="String(val)" @confirm="confirm" />
期望的结果是什么?
没有设置默认值应该不选中
实际的结果是什么?
默认选中了第一个
环境信息
No response
其他补充信息
No response
The text was updated successfully, but these errors were encountered: