Giter Site home page Giter Site logo

Comments (12)

07akioni avatar 07akioni commented on May 22, 2024

Add hourStep minuteStep and secondStep prop can solve the problem. Are you willing to create a PR? It won't be hard.

from naive-ui.

angela-1 avatar angela-1 commented on May 22, 2024

The xxStep can be done by isMinuteDisabled function like this:

function isMinuteDisabled(minute, selectedHour) {
  if (selectedHour === null) return false;
  return minute % 10 === 0 ? false : true;
}

and add one show-disabled prop can get goal.
It is clear that is-xx-disabled controls disabled values and show-disabled controls show/hide.

Your suggestions has a question.
How to deal with the relationship between xxStep and is-xx-disabled. If a user set both xxStep
and is-xx-disabled, there are two options:

  1. which one (step disabled) has higher priority?
  2. user should disabled all the values or just disabled values after filtered by step?

I think it is too heavy to add 3 prop for this and will puzzle user, "should i set step or set disabled value? It's not clear"

So far, I don't have a pr this feature: add show-disabled prop. Sorry!
After this, I will have a try.

Thanks for reply! 😄

from naive-ui.

07akioni avatar 07akioni commented on May 22, 2024

2. user should disabled all the values or just disabled values after filtered by step?

I thinks disabled can only controll the what does the item looks like (and whether it can be click). step and disabled shouldn't affect each other.

Maybe we can provide aseconds prop. For example :seconds="[30, 45]". Some people would like to see [0(disabled), 15(disabled), 30, 45] and others may like [30, 45]. Both is reasonable. If user pass just a number to seconds we treat it as a step.

It will be complex for users to define step by xxx-disabled.

from naive-ui.

w1301625107 avatar w1301625107 commented on May 22, 2024

If user pass just a number to seconds we treat it as a step.
如果用户传 secends 的值为8,如何处理呢?8不可以被60整除,但是可以被24 * 60 * 60 整除

  1. 报错
  2. 0:0:48- 0:0:56 - 0:1:04 - 0:0:12 - 0:0:20 这样吗

from naive-ui.

07akioni avatar 07akioni commented on May 22, 2024

If user pass just a number to seconds we treat it as a step.
如果用户传 secends 的值为8,如何处理呢?8不可以被60整除,但是可以被24 * 60 * 60 整除

  1. 报错
  2. 0:0:48- 0:0:56 - 0:1:04 - 0:0:12 - 0:0:20 这样吗

那可选的秒就是 0 8 16 24 32 40 48 56

from naive-ui.

w1301625107 avatar w1301625107 commented on May 22, 2024

那可选的秒就是 8 16 24 32 40 48 56

0 永远不会出现吗

from naive-ui.

07akioni avatar 07akioni commented on May 22, 2024

那可选的秒就是 8 16 24 32 40 48 56

0 永远不会出现吗

不好意思忘了 0😂 有的

from naive-ui.

w1301625107 avatar w1301625107 commented on May 22, 2024

那现在需求是这样吗

  1. is-xx-disabled 依然保持某些时刻展示但是不能点击的状态
  2. 如果需要隐藏某些时刻就用 seconds,minutes,hours
  3. 2的优先级比1高

from naive-ui.

07akioni avatar 07akioni commented on May 22, 2024

那现在需求是这样吗

  1. is-xx-disabled 依然保持某些时刻展示但是不能点击的状态
  2. 如果需要隐藏某些时刻就用 seconds,minutes,hours
  3. 2的优先级比1高

大意是对的,不过我想说的是这两个是正交的,不存在优先级的问题,是在做两件事。is-xxx-disabled 还会体现在输入框里面,这个 seconds 之类是不会影响的。

from naive-ui.

w1301625107 avatar w1301625107 commented on May 22, 2024

我明白了,意思是 seconds:[10,20,30] 会被 is-seconds-disabled 把 30变为不能点击的状态?

from naive-ui.

07akioni avatar 07akioni commented on May 22, 2024

我明白了,意思是 seconds:[10,20,30] 会被 is-seconds-disabled 把 30变为不能点击的状态?

对的,这是两个维度。

from naive-ui.

07akioni avatar 07akioni commented on May 22, 2024

ref #498

from naive-ui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.