uniapp底部弹出层

发布时间 2023-08-03 15:38:08作者: 干红
 methods: {
            changeRelation() {
                uni.showActionSheet({
                    itemList:['妻子','丈夫','妈妈','爸爸','爷爷','奶奶','儿子','女儿','兄弟姐妹','亲戚','同学','同事','朋友','长辈','其他'],
                    success: (res) => {
                        switch(res.tapIndex){
                            case 0:
                            this.friendInfo.friendRelation = '妻子'
                            return;
                            case 1:
                            this.friendInfo.friendRelation = '丈夫'
                            return;
                            case 2:
                            this.friendInfo.friendRelation = '妈妈'
                            return;
                            case 3:
                            this.friendInfo.friendRelation = '爸爸'
                            return;
                            case 4:
                            this.friendInfo.friendRelation = '爷爷'
                            return;
                            case 5:
                            this.friendInfo.friendRelation = '奶奶'
                            return;
                           
                        }
                    }
                })
            }
        }