Skip to content
New issue

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

[mt-picker] 能否按下toolbar 確認的同時,回傳所選值 #507

Closed
red010182 opened this issue Dec 9, 2016 · 1 comment
Closed

Comments

@red010182
Copy link

red010182 commented Dec 9, 2016

Mint UI version

2.0.5

如題,既然picker都提供toolbar了,那麼選擇完成之時,為何不能回傳所選值呢?

現在的用法需要自行監聽@change才能得到結果,甚至如果user沒有滾動picker直接按下toolbar確定,@change還不會被觸發,需要另外處理

能否提供一個簡便的方式:按下確定後直接回傳所選值?

@red010182 red010182 changed the title [mt-picker] 能否按下toolbar 確認的同時,回傳當前slot values [mt-picker] 能否按下toolbar 確認的同時,回傳所選值 Dec 9, 2016
@Leopoldthecoder
Copy link
Contributor

目前的设计,toolbar 里面的内容和行为都是自定义的,可能不太好侵入。不过你的问题仍然可以解决:

<mt-picker :slots="someSlots" show-toolbar ref="picker">
  <mt-button @click="handleConfirm">确认</mt-button>
</mt-picker>
handleConfirm() {
  console.log(this.$refs.picker.getValues())
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants