youzan / vant

A lightweight, customizable Vue UI library for mobile web apps.

Home Page:https://vant-ui.github.io/vant/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Picker 期望增加一个索引绑定至

Cyan-963852 opened this issue · comments

这个功能解决了什么问题?

有时候使用Picker组件时,只想单纯的获取选中的索引

你期望的 API 是什么样子的?

<van-picker v-model:index="selected" />

感觉同时支持两种 v-model 不是一个好的选择,因为 v-model 和 v-model:index 容易冲突。如果需要索引的话可以通过 change 或 confirm 事件来获取