浅谈vant组件Picker 选择器选单选问题
1.写遮罩
2.定义data
3.写事件
4.效果图
补充知识:vue使用vant编辑用户性别
我就废话不多说了,大家还是直接看代码吧~
v-model="isEditGenderShow"
:actions="actions"
cancel-text="取消"
close-on-click-action
@cancel="onCancel"
@select="onGenderSelect"
/>
export default {
name: "EditUserINfo",
components: {},
props: {},
data() {
return {
isEditGenderShow: false,
// name会显示出来,value是我们自己添加的
actions: [{ name: "男",value: 1 }, { name: "女",value:0 }]
};