Skip to content

🐛 [Bug]: Slider component, change the incoming props, the style has an error #225

Closed
@awspi

Description

@awspi

Version

latest

Vue Version

latest

Link to minimal reproduction

https://codesandbox.io/s/bitter-shadow-h5ep1v?file=/src/App.vue

Step to reproduce

<template>
  <div>
    <el-slider v-model="value" :max="max"  @change="change"/>
      value: {{ value }} max: {{ max }} ischangeEventTriggered: {{ischangeEventTriggered}}
      <button @click="maxChange">
        maxChange
      </button>
      <button @click="valChange">
        valChange
      </button>
    </div>


</template>

<script lang="ts" setup>
  import { ref } from 'vue'
  const value = ref(5)
  const max=ref(10)
  const ischangeEventTriggered=ref(false)

  const maxChange=()=>{
    max.value=20
  }
  const valChange=()=>{
    value.value=8
  }
  const change=(val)=>{
    ischangeEventTriggered.value=true
  }


</script>
<style scoped>
</style>

What is expected

No response

What is actually happening

  1. 修改传入的value的值 滑块位置不会立刻更新

image

  1. 修改传入的max/min tooltip位置对 但是滑块位置不对

image

Any additional comments (optional)

似乎只是style设置的不对,值是对的
其他组件库如element-plus是支持动态修改的

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions