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

nut-range 指定step,似乎是从0开计算了,应该和最小值绑定 #3097

Closed
doupo opened this issue Jun 3, 2024 · 1 comment
Closed

Comments

@doupo
Copy link

doupo commented Jun 3, 2024

NutUI 包名

@nutui/nutui-taro

NutUI 版本号

4.3.8

平台

weapp

重现链接

https://nutui.jd.com/playground/#eyJBcHAudnVlIjoiPHRlbXBsYXRlPlxuPG51dC1yYW5nZVxuICAgICAgaGlkZGVuLXJhbmdlXG4gICAgICBoaWRkZW4tdGFnXG4gICAgICB2LW1vZGVsPVwidmFsXCJcbiAgICAgIDpzaG93LXN0b3BzPVwidHJ1ZVwiXG4gICAgICA6c2hvdy10b29sdGlwPVwiZmFsc2VcIlxuICAgICAgOnN0ZXA9XCIyMFwiXG4gICAgICA6bWluPVwiMTBcIlxuICAgICAgOm1heD1cIjkwXCJcbiAgICAgIDptYXJrcz1cIm1hcmtzXCJcbi8+XG48L3RlbXBsYXRlPlxuXG48c2NyaXB0IHNldHVwPlxuICBpbXBvcnQge3JlZn0gZnJvbSBcInZ1ZVwiO1xuY29uc3QgdmFsID0gcmVmKDMwKVxuY29uc3QgbWFya3MgPSByZWYoe1xuICAgIDEwOiAnMTAlJyxcbiAgICAzMDogXCIzMCVcIixcbiAgICA1MDogXCI1MCVcIixcbiAgICA3MDogXCI3MCVcIixcbiAgICA5MDogXCI5MCVcIlxuIH0pXG48L3NjcmlwdD4ifQ==

重现步骤

<template>
<nut-range
      hidden-range
      hidden-tag
      v-model="val"
      :show-stops="true"
      :show-tooltip="false"
      :step="20"
      :min="10"
      :max="90"
      :marks="marks"
/>
</template>

<script setup>
  import {ref} from "vue";
const val = ref(30)
const marks = ref({
    10: '10%',
    30: "30%",
    50: "50%",
    70: "70%",
    90: "90%"
 })
</script>

期望的结果是什么?

当最小值为10,当前val为30的时候,step为20,向前滑动应该为10,向后滑动应该为50

实际的结果是什么?

实际上:
向前滑动:20
向后滑动:60

这个step似乎绑定起始位置为0了,不随着最小值变化

环境信息

No response

其他补充信息

No response

@doupo
Copy link
Author

doupo commented Jun 5, 2024

同时,刻度标记
const marks = ref({
0: 0,
20: 20,
40: 40,
60: 60,
80: 80,
100: 100
})
只能显示数字么,比如,我想刻度显示的是 50%,就实现不了

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

No branches or pull requests

2 participants