Comments (12)
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.
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:
- which one (
step
disabled
) has higher priority? - 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.
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.
If user pass just a number to seconds we treat it as a step.
如果用户传 secends 的值为8,如何处理呢?8不可以被60整除,但是可以被24 * 60 * 60 整除
- 报错
- 0:0:48- 0:0:56 - 0:1:04 - 0:0:12 - 0:0:20 这样吗
from naive-ui.
If user pass just a number to seconds we treat it as a step.
如果用户传 secends 的值为8,如何处理呢?8不可以被60整除,但是可以被24 * 60 * 60 整除
- 报错
- 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.
那可选的秒就是 8 16 24 32 40 48 56
0 永远不会出现吗
from naive-ui.
那可选的秒就是 8 16 24 32 40 48 56
0 永远不会出现吗
不好意思忘了 0😂 有的
from naive-ui.
那现在需求是这样吗
- is-xx-disabled 依然保持某些时刻展示但是不能点击的状态
- 如果需要隐藏某些时刻就用 seconds,minutes,hours
- 2的优先级比1高
from naive-ui.
那现在需求是这样吗
- is-xx-disabled 依然保持某些时刻展示但是不能点击的状态
- 如果需要隐藏某些时刻就用 seconds,minutes,hours
- 2的优先级比1高
大意是对的,不过我想说的是这两个是正交的,不存在优先级的问题,是在做两件事。is-xxx-disabled 还会体现在输入框里面,这个 seconds 之类是不会影响的。
from naive-ui.
我明白了,意思是 seconds:[10,20,30] 会被 is-seconds-disabled 把 30变为不能点击的状态?
from naive-ui.
我明白了,意思是 seconds:[10,20,30] 会被 is-seconds-disabled 把 30变为不能点击的状态?
对的,这是两个维度。
from naive-ui.
ref #498
from naive-ui.
Related Issues (20)
- The font-weight variable of button component has no prefix
- 滚动条横向滚动 支持鼠标滚论 HOT 1
- vue - n-tooltip <template #trigger> Unrecognized slot name ts HOT 3
- 标记(badge)不能遮盖住「按钮聚焦时高亮的边框」 HOT 1
- NPopover doesn't display when triggered using NFloatButton HOT 1
- 日期选择器交互优化 HOT 2
- Signature Pad Component
- datatable使用max-height时, 调节列宽无法看到横向滚动条 HOT 3
- cascader组件增加返现插槽
- 表单 Form设置'auto'时标签无法重新自动计算字段宽度 HOT 1
- n-select组件在设置了filterable属性之后,无法通过再次点击选择框让下拉框消失 HOT 1
- 部署到netlify上暗黑主题刷新页面无法加载相应样式 HOT 4
- 在设定不显示透明度的前提下,从色板中选择颜色依然会显示透明度
- 在n-uploader的on-download回调中,可以更新文件的下载URL HOT 2
- n-select menu max-height not working HOT 1
- 公式 Equation 组件 建议value值(Latex 格式的公式表达式)支持编辑修改 HOT 1
- 固钉组件 能否增加prop target来设置需要监听其滚动事件的元素
- useDialog()方法在自定义js中返回undefined HOT 3
- 【n-input-number】组件 `input-props` 无效 HOT 2
- Search Component
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from naive-ui.