Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Element
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
林焕东
Element
Commits
242a0a52
Commit
242a0a52
authored
Sep 12, 2016
by
qingwei.li
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TimePicker: scrollable time picker
add changelog
parent
c9773b22
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
10 deletions
+24
-10
CHANGELOG.md
CHANGELOG.md
+1
-0
packages/date-picker/src/basic/time-spinner.vue
packages/date-picker/src/basic/time-spinner.vue
+10
-0
packages/date-picker/src/css/time-picker.css
packages/date-picker/src/css/time-picker.css
+12
-4
packages/date-picker/src/css/time-spinner.css
packages/date-picker/src/css/time-spinner.css
+1
-6
No files found.
CHANGELOG.md
View file @
242a0a52
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
*2016-XX-XX*
*2016-XX-XX*
-
修复 Select 多选时选项变为空数组后 placeholder 不出现的问题
-
修复 Select 多选时选项变为空数组后 placeholder 不出现的问题
-
修复 TimePicker 时间选择可滚动
### 1.0.0-rc.3
### 1.0.0-rc.3
...
...
packages/date-picker/src/basic/time-spinner.vue
View file @
242a0a52
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
{{
hours
}}
{{
hours
}}
<div
<div
@
mouseenter=
"emitSelectRange('hours')"
@
mouseenter=
"emitSelectRange('hours')"
@
mousewheel=
"handleScroll('hour')"
class=
"el-time-spinner__wrapper"
class=
"el-time-spinner__wrapper"
ref=
"hour"
>
ref=
"hour"
>
<ul
class=
"el-time-spinner__list"
>
<ul
class=
"el-time-spinner__list"
>
...
@@ -17,6 +18,7 @@
...
@@ -17,6 +18,7 @@
</div>
</div>
<div
<div
@
mouseenter=
"emitSelectRange('minutes')"
@
mouseenter=
"emitSelectRange('minutes')"
@
mousewheel=
"handleScroll('minute')"
class=
"el-time-spinner__wrapper"
class=
"el-time-spinner__wrapper"
ref=
"minute"
>
ref=
"minute"
>
<ul
class=
"el-time-spinner__list"
>
<ul
class=
"el-time-spinner__list"
>
...
@@ -30,6 +32,7 @@
...
@@ -30,6 +32,7 @@
</div>
</div>
<div
<div
@
mouseenter=
"emitSelectRange('seconds')"
@
mouseenter=
"emitSelectRange('seconds')"
@
mousewheel=
"handleScroll('second')"
class=
"el-time-spinner__wrapper"
class=
"el-time-spinner__wrapper"
ref=
"second"
>
ref=
"second"
>
<ul
class=
"el-time-spinner__list"
>
<ul
class=
"el-time-spinner__list"
>
...
@@ -140,6 +143,13 @@
...
@@ -140,6 +143,13 @@
}
}
},
},
handleScroll
(
type
)
{
const
ajust
=
{};
ajust
[
`
${
type
}
s`
]
=
Math
.
min
(
Math
.
floor
((
this
.
$refs
[
type
].
scrollTop
-
80
)
/
32
+
3
),
59
);
this
.
$emit
(
'
change
'
,
ajust
);
},
ajustScrollTop
()
{
ajustScrollTop
()
{
this
.
$refs
.
hour
.
scrollTop
=
Math
.
max
(
0
,
(
this
.
hours
-
2.5
)
*
32
+
80
);
this
.
$refs
.
hour
.
scrollTop
=
Math
.
max
(
0
,
(
this
.
hours
-
2.5
)
*
32
+
80
);
this
.
$refs
.
minute
.
scrollTop
=
Math
.
max
(
0
,
(
this
.
minutes
-
2.5
)
*
32
+
80
);
this
.
$refs
.
minute
.
scrollTop
=
Math
.
max
(
0
,
(
this
.
minutes
-
2.5
)
*
32
+
80
);
...
...
packages/date-picker/src/css/time-picker.css
View file @
242a0a52
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
font-size
:
0
;
font-size
:
0
;
display
:
flex
;
display
:
flex
;
position
:
relative
;
position
:
relative
;
overflow
:
hidden
;
&::after,
&::before
{
&::after,
&::before
{
content
:
":"
;
content
:
":"
;
...
@@ -24,18 +25,25 @@
...
@@ -24,18 +25,25 @@
color
:
#fff
;
color
:
#fff
;
position
:
absolute
;
position
:
absolute
;
font-size
:
14px
;
font-size
:
14px
;
margin-top
:
-
8
px
;
margin-top
:
-
15
px
;
line-height
:
16px
;
line-height
:
16px
;
z-index
:
1
;
background-color
:
#20a0ff
;
height
:
32px
;
z-index
:
-1
;
left
:
0
;
right
:
0
;
box-sizing
:
border-box
;
padding-top
:
6px
;
text-align
:
left
;
}
}
&
::after
{
&
::after
{
left
:
calc
(
100%
/
3
);
left
:
calc
(
100%
/
3
*
2
);
margin-left
:
-2px
;
margin-left
:
-2px
;
}
}
&
::before
{
&
::before
{
righ
t
:
calc
(
100%
/
3
);
padding-lef
t
:
calc
(
100%
/
3
);
margin-right
:
-2px
;
margin-right
:
-2px
;
}
}
}
}
...
...
packages/date-picker/src/css/time-spinner.css
View file @
242a0a52
...
@@ -34,18 +34,13 @@
...
@@ -34,18 +34,13 @@
line-height
:
32px
;
line-height
:
32px
;
font-size
:
12px
;
font-size
:
12px
;
&:
hover
:
not
(.
disabled
)
{
&:
hover
:
not
(.
disabled
)
:
not
(.
active
)
{
background
:
#E5E9F2
;
background
:
#E5E9F2
;
cursor
:
pointer
;
cursor
:
pointer
;
}
}
&
.active
:not
(
.disabled
)
{
&
.active
:not
(
.disabled
)
{
background-color
:
#20a0ff
;
color
:
#fff
;
color
:
#fff
;
&:hover
{
background-color
:
#1D8CE0
;
}
}
}
&
.disabled
{
&
.disabled
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment