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

feat(components): [slider] support model-value and fix change event error #16777

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from

Conversation

FrontEndDog
Copy link
Member

@FrontEndDog FrontEndDog commented May 7, 2024

Please make sure these boxes are checked before submitting your PR, thank you!

  • Make sure you follow contributing guide English | (中文 | Español | Français).
  • Make sure you are merging your commits to dev branch.
  • Add some descriptions and refer to relative issues for your PR.
  1. Support use model-value.
  2. Support Not incoming model-value/v-model, So change the default value of model-value to undefined.
  3. Delete oldValue of type, because never used.
  4. Fix change event error when use model-value.
  5. Add test case.

test case

fixed #14998

Copy link

github-actions bot commented May 7, 2024

@github-actions github-actions bot added the CommitMessage::Qualified Qualified commit message label May 7, 2024
Copy link

github-actions bot commented May 7, 2024

🧪 Playground Preview: https://element-plus.run/?pr=16777
Please comment the example via this playground if needed.

return `${
((props.modelValue - min.value) / (max.value - min.value)) * 100
}%`
return ((props.modelValue - min.value) / (max.value - min.value)) * 100
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic here seems to be the same as before, and there should be no need to change it. 🤔

if (props.modelValue === undefined) return

if (props.range) {
if (Array.isArray(props.modelValue)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (Array.isArray(props.modelValue)) {
if (isArray(props.modelValue)) {

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

Successfully merging this pull request may close these issues.

[Component] [slider] slider, model-value and @change these all not work
2 participants