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
65557255
Commit
65557255
authored
Jan 18, 2017
by
baiyaaaaa
Committed by
GitHub
Jan 18, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2466 from Leopoldthecoder/select-style
Select: update style if initially invisible
parents
b137274a
b5d59227
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
3 deletions
+14
-3
packages/select/src/select.vue
packages/select/src/select.vue
+14
-3
No files found.
packages/select/src/select.vue
View file @
65557255
...
...
@@ -363,7 +363,13 @@
},
getOption
(
value
)
{
const
option
=
this
.
cachedOptions
.
filter
(
option
=>
option
.
value
===
value
)[
0
];
let
option
;
for
(
let
i
=
0
,
len
=
this
.
cachedOptions
.
length
;
i
<
len
;
i
++
)
{
const
cachedOption
=
this
.
cachedOptions
[
i
];
if
(
cachedOption
.
value
===
value
)
{
option
=
cachedOption
;
}
}
if
(
option
)
return
option
;
const
label
=
typeof
value
===
'
string
'
||
typeof
value
===
'
number
'
?
value
:
''
;
...
...
@@ -606,6 +612,11 @@
resetInputWidth
()
{
this
.
inputWidth
=
this
.
$refs
.
reference
.
$el
.
getBoundingClientRect
().
width
;
},
handleResize
()
{
this
.
resetInputWidth
();
if
(
this
.
multiple
)
this
.
resetInputHeight
();
}
},
...
...
@@ -632,7 +643,7 @@
if
(
this
.
multiple
&&
Array
.
isArray
(
this
.
value
)
&&
this
.
value
.
length
>
0
)
{
this
.
currentPlaceholder
=
''
;
}
addResizeListener
(
this
.
$el
,
this
.
resetInputWidth
);
addResizeListener
(
this
.
$el
,
this
.
handleResize
);
if
(
this
.
remote
&&
this
.
multiple
)
{
this
.
resetInputHeight
();
}
...
...
@@ -644,7 +655,7 @@
},
destroyed
()
{
if
(
this
.
resetInputWidth
)
removeResizeListener
(
this
.
$el
,
this
.
resetInputWidth
);
if
(
this
.
handleResize
)
removeResizeListener
(
this
.
$el
,
this
.
handleResize
);
}
};
</
script
>
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