element [Bug Report] An argument needs to be provided that tells whether the input event emitted by el-slider is triggered by setting value in JavaScript or by mouse etc.

ecbunoof  于 3个月前  发布在  Java
关注(0)|答案(1)|浏览(74)

Element UI version

2.13.2

OS/Browsers version

Google Chrome

Vue version

3.0.0-beta.14

https://codesandbox.io/s/heuristic-sound-qw5y9?file=/src/App.vue:11-266

Steps to reproduce

<template>
  <div>
    <el-slider @input="handleSliderInput" :value="value"/>
    <button type="button" @click="buttonClick">Click me</button>
  </div>
</template>
<script>

export default {
  name: "App",
  data() {
    return {
      value: 1
    };
  },
  components: {
    // HelloWorld
    "el-slider": Slider
  },
  methods: {
    handleSliderInput(v) {
      console.log(arguments);
      this.value = v;
    },
    buttonClick() {
      console.log("button click");
      this.value  ;
    }
  }
};
</script>

What is Expected?

There needs to be a value, passed in handleSliderInput() , that tells whether the input event is generated by change of the value property from JavaScript or manually by mouse.

What is actually happening?

There is no such value that one could get in the input handler method like handleSliderInput() .

5w9g7ksd

5w9g7ksd1#

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

相关问题