Skip to content

fix(slider): 完成组件自检清单,修复输入框限制问题和最小值样式问题 #93

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

Merged
merged 1 commit into from
Dec 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/devui-vue/devui/slider/src/slider.scss
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
.devui-min_count {
position: absolute;
top: 15px;
left: 0;
font-size: $devui-font-size;
color: $devui-text;
}
Expand Down
7 changes: 2 additions & 5 deletions packages/devui-vue/devui/slider/src/slider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,8 @@ export default defineComponent({
inputValue.value = props.min;
percentDispaly.value = '0%';
} else {
if (inputValue.value < props.min) {
inputValue.value = props.min;
}
if (inputValue.value > props.max) {
inputValue.value = props.max;
if (inputValue.value < props.min || inputValue.value > props.max) {
return
}
const re = /^(?:[1-9]?\d|100)$/;
if (re.test(`${inputValue.value}`)) {
Expand Down