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
4eb5cf35
Commit
4eb5cf35
authored
Oct 24, 2016
by
杨奕
Committed by
GitHub
Oct 24, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #608 from QingWei-Li/fix/date-picker
DatePicker: fix trigger multiple watch, fixed #597
parents
f97d885d
202a77ab
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
12 additions
and
14 deletions
+12
-14
.gitattributes
.gitattributes
+1
-1
packages/date-picker/src/basic/month-table.vue
packages/date-picker/src/basic/month-table.vue
+1
-1
packages/date-picker/src/basic/time-spinner.vue
packages/date-picker/src/basic/time-spinner.vue
+0
-1
packages/date-picker/src/panel/date-range.vue
packages/date-picker/src/panel/date-range.vue
+3
-0
packages/date-picker/src/panel/date.vue
packages/date-picker/src/panel/date.vue
+2
-2
packages/date-picker/src/panel/time-range.vue
packages/date-picker/src/panel/time-range.vue
+4
-0
packages/date-picker/src/panel/time-select.vue
packages/date-picker/src/panel/time-select.vue
+0
-8
packages/date-picker/src/panel/time.vue
packages/date-picker/src/panel/time.vue
+1
-0
packages/date-picker/src/picker.vue
packages/date-picker/src/picker.vue
+0
-1
No files found.
.gitattributes
View file @
4eb5cf35
*.js linguist-language=Vue
test/**/
*.js linguist-language=Vue
packages/date-picker/src/basic/month-table.vue
View file @
4eb5cf35
...
@@ -47,7 +47,7 @@
...
@@ -47,7 +47,7 @@
</table>
</table>
</
template
>
</
template
>
<
script
type=
"text/
ecmascript-6
"
>
<
script
type=
"text/
babel
"
>
import
{
$t
}
from
'
../util
'
;
import
{
$t
}
from
'
../util
'
;
export
default
{
export
default
{
...
...
packages/date-picker/src/basic/time-spinner.vue
View file @
4eb5cf35
...
@@ -78,7 +78,6 @@
...
@@ -78,7 +78,6 @@
this
.
hoursPrivate
=
oldVal
;
this
.
hoursPrivate
=
oldVal
;
}
}
this
.
$refs
.
hour
.
scrollTop
=
Math
.
max
(
0
,
(
this
.
hoursPrivate
-
2.5
)
*
32
+
80
);
this
.
$refs
.
hour
.
scrollTop
=
Math
.
max
(
0
,
(
this
.
hoursPrivate
-
2.5
)
*
32
+
80
);
this
.
$emit
(
'
change
'
,
{
hours
:
newVal
});
this
.
$emit
(
'
change
'
,
{
hours
:
newVal
});
},
},
...
...
packages/date-picker/src/panel/date-range.vue
View file @
4eb5cf35
...
@@ -400,6 +400,9 @@
...
@@ -400,6 +400,9 @@
},
},
handleRangePick
(
val
,
close
=
true
)
{
handleRangePick
(
val
,
close
=
true
)
{
if
(
this
.
maxDate
===
val
.
maxDate
&&
this
.
minDate
===
val
.
minDate
)
{
return
;
}
this
.
maxDate
=
val
.
maxDate
;
this
.
maxDate
=
val
.
maxDate
;
this
.
minDate
=
val
.
minDate
;
this
.
minDate
=
val
.
minDate
;
...
...
packages/date-picker/src/panel/date.vue
View file @
4eb5cf35
...
@@ -260,8 +260,8 @@
...
@@ -260,8 +260,8 @@
}
else
{
}
else
{
this
.
date
.
setMonth
(
month
);
this
.
date
.
setMonth
(
month
);
this
.
resetDate
();
this
.
resetDate
();
this
.
value
=
new
Date
(
this
.
date
.
getFullYear
(),
month
,
1
);
const
value
=
new
Date
(
this
.
date
.
getFullYear
(),
month
,
1
);
this
.
$emit
(
'
pick
'
,
this
.
value
);
this
.
$emit
(
'
pick
'
,
value
);
}
}
},
},
...
...
packages/date-picker/src/panel/time-range.vue
View file @
4eb5cf35
...
@@ -87,6 +87,9 @@
...
@@ -87,6 +87,9 @@
watch
:
{
watch
:
{
value
(
val
)
{
value
(
val
)
{
const
time
=
clacTime
(
val
);
const
time
=
clacTime
(
val
);
if
(
time
.
minTime
===
this
.
minTime
&&
time
.
maxTime
===
this
.
maxTime
)
{
return
;
}
this
.
handleMinChange
({
this
.
handleMinChange
({
hours
:
time
.
minTime
.
getHours
(),
hours
:
time
.
minTime
.
getHours
(),
...
@@ -183,6 +186,7 @@
...
@@ -183,6 +186,7 @@
this
.
minTime
=
limitRange
(
this
.
minTime
,
minSelectableRange
);
this
.
minTime
=
limitRange
(
this
.
minTime
,
minSelectableRange
);
this
.
maxTime
=
limitRange
(
this
.
maxTime
,
maxSelectableRange
);
this
.
maxTime
=
limitRange
(
this
.
maxTime
,
maxSelectableRange
);
if
(
first
)
return
;
this
.
$emit
(
'
pick
'
,
[
this
.
minTime
,
this
.
maxTime
],
visible
,
first
);
this
.
$emit
(
'
pick
'
,
[
this
.
minTime
,
this
.
maxTime
],
visible
,
first
);
},
},
...
...
packages/date-picker/src/panel/time-select.vue
View file @
4eb5cf35
...
@@ -72,14 +72,6 @@
...
@@ -72,14 +72,6 @@
if
(
this
.
value
&&
val
&&
compareTime
(
this
.
value
,
val
)
===
-
1
)
{
if
(
this
.
value
&&
val
&&
compareTime
(
this
.
value
,
val
)
===
-
1
)
{
this
.
$emit
(
'
pick
'
);
this
.
$emit
(
'
pick
'
);
}
}
},
value
(
val
,
old
)
{
if
(
val
&&
this
.
items
.
some
(
i
=>
i
.
value
===
val
&&
!
i
.
disabled
))
{
this
.
$emit
(
'
pick
'
,
val
,
true
);
}
else
{
this
.
$emit
(
'
pick
'
,
old
,
true
);
}
}
}
},
},
...
...
packages/date-picker/src/panel/time.vue
View file @
4eb5cf35
...
@@ -129,6 +129,7 @@
...
@@ -129,6 +129,7 @@
},
},
handleConfirm
(
visible
=
false
,
first
)
{
handleConfirm
(
visible
=
false
,
first
)
{
if
(
first
)
return
;
const
date
=
new
Date
(
limitRange
(
this
.
currentDate
,
this
.
selectableRange
));
const
date
=
new
Date
(
limitRange
(
this
.
currentDate
,
this
.
selectableRange
));
this
.
$emit
(
'
pick
'
,
date
,
visible
,
first
);
this
.
$emit
(
'
pick
'
,
date
,
visible
,
first
);
},
},
...
...
packages/date-picker/src/picker.vue
View file @
4eb5cf35
...
@@ -46,7 +46,6 @@ const newPopper = {
...
@@ -46,7 +46,6 @@ const newPopper = {
beforeDestroy
:
Popper
.
beforeDestroy
beforeDestroy
:
Popper
.
beforeDestroy
};
};
// const FUNCTION_KEYS = [13, 16, 17, 18, 19, 20, 27, 33, 34, 35, 36, 37, 38, 39, 40];
const
RANGE_SEPARATOR
=
'
-
'
;
const
RANGE_SEPARATOR
=
'
-
'
;
const
DEFAULT_FORMATS
=
{
const
DEFAULT_FORMATS
=
{
date
:
'
yyyy-MM-dd
'
,
date
:
'
yyyy-MM-dd
'
,
...
...
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