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

refactor(switch): use composition api #3885

Merged
merged 6 commits into from
Apr 11, 2021
Merged

refactor(switch): use composition api #3885

merged 6 commits into from
Apr 11, 2021

Conversation

ajuner
Copy link
Member

@ajuner ajuner commented Mar 31, 2021

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 ...

  • New feature
  • Bug fix
  • Site / document update
  • Component style update
  • TypeScript definition update
  • Refactoring
  • Code style optimization
  • Branch merge
  • Other (about what?)

What's the background?

  1. Describe the source of requirement.
  2. Resolve what problem.
  3. Related issue link.

API Realization (Optional if not new feature)

  1. Basic thought of solution and other optional proposal.
  2. List final API realization and usage sample.
  3. GIF or snapshot should be provided if includes UI/interactive modification.

What's the effect? (Optional if not new feature)

  1. Does this PR affect user? Which part will be affected?
  2. What will say in changelog?
  3. Does this PR contains potential break change or other risk?

Changelog description (Optional if not new feature)

  1. English description
  2. Chinese description (optional)

Self Check before Merge

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

Additional Plan? (Optional if not new feature)

If this PR related with other PR or following info. You can type here.

@ajuner
Copy link
Member Author

ajuner commented Mar 31, 2021

大佬们帮忙看看

@ajuner
Copy link
Member Author

ajuner commented Mar 31, 2021

还有要不要把defaultChecked去掉好了

@tangjinzhou
Copy link
Member

如果去掉就是破坏性更新 default 系列在 3.0 里面移除吧 现在给即将废弃的 warning 提示

@ajuner
Copy link
Member Author

ajuner commented Apr 3, 2021

如果去掉就是破坏性更新 default 系列在 3.0 里面移除吧 现在给即将废弃的 warning 提示

Ok

@ajuner
Copy link
Member Author

ajuner commented Apr 3, 2021

我改改

@ajuner ajuner requested a review from tangjinzhou April 5, 2021 09:32
@ajuner ajuner marked this pull request as draft April 9, 2021 06:56
@ajuner ajuner marked this pull request as ready for review April 9, 2021 07:23
@ajuner
Copy link
Member Author

ajuner commented Apr 9, 2021

done

components/switch/index.tsx Outdated Show resolved Hide resolved
components/vc-switch/src/Switch.tsx Show resolved Hide resolved
@tangjinzhou tangjinzhou merged commit 67b9da7 into vueComponent:next Apr 11, 2021
tangjinzhou added a commit that referenced this pull request Apr 11, 2021
},
emits: ['update:checked', 'mouseup', 'change', 'click'],
setup(props, { attrs, slots, emit, expose }) {
const checked = ref('checked' in props ? !!props.checked : !!props.defaultChecked);
Copy link
Member

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);
Copy link
Member

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);

@ajuner ajuner deleted the switch branch April 19, 2021 01:12
@ajuner ajuner mentioned this pull request May 11, 2021
64 tasks
@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants