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
1cc45b83
Commit
1cc45b83
authored
Jul 25, 2018
by
hetech
Committed by
Jikkai Xiao
Jul 25, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Input: fix wrong style of Input suffix (#12108)
* Input: fix wrong style of Input * update input.vue * add test case
parent
69dd5399
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
2 deletions
+37
-2
packages/input/src/input.vue
packages/input/src/input.vue
+10
-2
test/unit/specs/input.spec.js
test/unit/specs/input.spec.js
+27
-0
No files found.
packages/input/src/input.vue
View file @
1cc45b83
...
@@ -291,8 +291,16 @@
...
@@ -291,8 +291,16 @@
}
}
},
},
calcIconOffset
(
place
)
{
calcIconOffset
(
place
)
{
const
el
=
this
.
$el
.
querySelector
(
`.el-input__
${
place
}
`
);
let
elList
=
[].
slice
.
call
(
this
.
$el
.
querySelectorAll
(
`.el-input__
${
place
}
`
)
||
[]);
if
(
!
el
||
el
.
parentNode
!==
this
.
$el
)
return
;
if
(
!
elList
.
length
)
return
;
let
el
=
null
;
for
(
let
i
=
0
;
i
<
elList
.
length
;
i
++
)
{
if
(
elList
[
i
].
parentNode
===
this
.
$el
)
{
el
=
elList
[
i
];
break
;
}
}
if
(
!
el
)
return
;
const
pendantMap
=
{
const
pendantMap
=
{
suffix
:
'
append
'
,
suffix
:
'
append
'
,
prefix
:
'
prepend
'
prefix
:
'
prepend
'
...
...
test/unit/specs/input.spec.js
View file @
1cc45b83
...
@@ -180,6 +180,33 @@ describe('Input', () => {
...
@@ -180,6 +180,33 @@ describe('Input', () => {
});
});
});
});
it
(
'
Input contains Select and append slot
'
,
(
done
)
=>
{
vm
=
createVue
({
template
:
`
<el-input v-model="value" clearable class="input-with-select" ref="input">
<el-select v-model="select" slot="prepend" placeholder="请选择">
<el-option label="餐厅名" value="1"></el-option>
<el-option label="订单号" value="2"></el-option>
<el-option label="用户电话" value="3"></el-option>
</el-select>
<el-button slot="append" icon="el-icon-search"></el-button>
</el-input>
`
,
data
()
{
return
{
value
:
'
1234
'
};
}
},
true
);
vm
.
$refs
.
input
.
hovering
=
true
;
setTimeout
(()
=>
{
const
suffixEl
=
document
.
querySelector
(
'
.input-with-select > .el-input__suffix
'
);
expect
(
suffixEl
).
to
.
not
.
be
.
null
;
expect
(
suffixEl
.
style
.
transform
).
to
.
not
.
be
.
empty
;
done
();
},
20
);
});
describe
(
'
Input Events
'
,
()
=>
{
describe
(
'
Input Events
'
,
()
=>
{
it
(
'
event:focus & blur
'
,
done
=>
{
it
(
'
event:focus & blur
'
,
done
=>
{
vm
=
createVue
({
vm
=
createVue
({
...
...
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