-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
refactor(switch): use composition api #3885
Conversation
大佬们帮忙看看 |
还有要不要把defaultChecked去掉好了 |
如果去掉就是破坏性更新 default 系列在 3.0 里面移除吧 现在给即将废弃的 warning 提示 |
Ok |
我改改 |
done |
}, | ||
emits: ['update:checked', 'mouseup', 'change', 'click'], | ||
setup(props, { attrs, slots, emit, expose }) { | ||
const checked = ref('checked' in props ? !!props.checked : !!props.defaultChecked); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
没有 watch checked
return; | ||
} | ||
checked.value = !checked.value; | ||
emit('update:checked', checked); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
emit('update:checked', checked.value);
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
First of all, thank you for your contribution! 😄
New feature please send pull request to feature branch, and rest to master branch. Pull request will be merged after one of collaborators approve. Please makes sure that these form are filled before submitting your pull request, thank you!
[中文版模板 / Chinese template]
This is a ...
What's the background?
API Realization (Optional if not new feature)
What's the effect? (Optional if not new feature)
Changelog description (Optional if not new feature)
Self Check before Merge
Additional Plan? (Optional if not new feature)