async onConfirm() { this.$toast.loading({ message: '保存中...', forbidClick: true, // 禁止背景點擊 duration: 0 // 持續展示 }) try { const localGender = this.localGender await updateUserprofile({ gender: localGender }) // 更新視圖
this.$emit('input', localGender) // 關閉彈層
this.$emit('close') // 提示成功
this.$toast.success('更新成功') } catch (err) { this.$toast.fail('更新失敗') } }, onPickerChange(picker, value, index) { this.localGender = index } } }
