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
70aed33c
Commit
70aed33c
authored
Oct 20, 2016
by
Leopoldthecoder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Select: add resize event
parent
9e0afd38
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
1 deletion
+13
-1
build/config.js
build/config.js
+1
-0
packages/select/src/select.vue
packages/select/src/select.vue
+10
-0
packages/table/src/table.vue
packages/table/src/table.vue
+1
-1
packages/theme-default/src/select.css
packages/theme-default/src/select.css
+1
-0
src/utils/resize-event.js
src/utils/resize-event.js
+0
-0
No files found.
build/config.js
View file @
70aed33c
...
...
@@ -15,6 +15,7 @@ Object.keys(dependencies).forEach(function (key) {
externals
[
'
element-ui/src/utils/clickoutside
'
]
=
'
element-ui/lib/utils/clickoutside
'
;
externals
[
'
element-ui/src/utils/popper
'
]
=
'
element-ui/lib/utils/popper
'
;
externals
[
'
element-ui/src/utils/vue-popper
'
]
=
'
element-ui/lib/utils/vue-popper
'
;
externals
[
'
element-ui/src/utils/resize-event
'
]
=
'
element-ui/lib/utils/resize-event
'
;
exports
.
externals
=
Object
.
assign
({
vue
:
'
vue
'
...
...
packages/select/src/select.vue
View file @
70aed33c
...
...
@@ -71,6 +71,7 @@
import
debounce
from
'
throttle-debounce/debounce
'
;
import
Clickoutside
from
'
element-ui/src/utils/clickoutside
'
;
import
{
addClass
,
removeClass
,
hasClass
}
from
'
wind-dom/src/class
'
;
import
{
addResizeListener
,
removeResizeListener
}
from
'
element-ui/src/utils/resize-event
'
;
export
default
{
mixins
:
[
emitter
],
...
...
@@ -505,6 +506,10 @@
this
.
options
.
splice
(
index
,
1
);
}
this
.
broadcast
(
'
option
'
,
'
resetIndex
'
);
},
resetInputWidth
()
{
this
.
inputWidth
=
this
.
$refs
.
reference
.
$el
.
getBoundingClientRect
().
width
;
}
},
...
...
@@ -528,6 +533,7 @@
},
mounted
()
{
addResizeListener
(
this
.
$el
,
this
.
resetInputWidth
);
if
(
this
.
remote
&&
this
.
multiple
&&
Array
.
isArray
(
this
.
value
))
{
this
.
selected
=
this
.
options
.
reduce
((
prev
,
curr
)
=>
{
return
this
.
value
.
indexOf
(
curr
.
value
)
>
-
1
?
prev
.
concat
(
curr
)
:
prev
;
...
...
@@ -541,6 +547,10 @@
this
.
inputWidth
=
this
.
$refs
.
reference
.
$el
.
getBoundingClientRect
().
width
;
}
});
},
destroyed
()
{
if
(
this
.
resetInputWidth
)
removeResizeListener
(
this
.
$el
,
this
.
resetInputWidth
);
}
};
</
script
>
packages/table/src/table.vue
View file @
70aed33c
...
...
@@ -86,7 +86,7 @@
<
script
type=
"text/babel"
>
import
throttle
from
'
throttle-debounce/throttle
'
;
import
debounce
from
'
throttle-debounce/debounce
'
;
import
{
addResizeListener
,
removeResizeListener
}
from
'
.
/resize-event
'
;
import
{
addResizeListener
,
removeResizeListener
}
from
'
element-ui/src/utils
/resize-event
'
;
import
TableStore
from
'
./table-store
'
;
import
TableLayout
from
'
./table-layout
'
;
import
TableBody
from
'
./table-body
'
;
...
...
packages/theme-default/src/select.css
View file @
70aed33c
...
...
@@ -105,6 +105,7 @@
@e
tags
{
position
:
absolute
;
line-height
:
normal
;
white-space
:
normal
;
z-index
:
var
(
--index-top
);
}
...
...
packages/table/src
/resize-event.js
→
src/utils
/resize-event.js
View file @
70aed33c
File moved
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