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
3f64571f
Commit
3f64571f
authored
Feb 18, 2017
by
杨奕
Committed by
baiyaaaaa
Feb 18, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Carousel: responsive to item change (#2775)
parent
450cf81d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
7 deletions
+14
-7
examples/docs/zh-CN/input.md
examples/docs/zh-CN/input.md
+6
-1
packages/carousel/src/main.vue
packages/carousel/src/main.vue
+7
-5
test/unit/specs/carousel.spec.js
test/unit/specs/carousel.spec.js
+1
-1
No files found.
examples/docs/zh-CN/input.md
View file @
3f64571f
...
...
@@ -528,6 +528,8 @@ export default {
custom-item=
"my-item-zh"
placeholder=
"请输入内容"
@
select=
"handleSelect"
icon=
"edit"
:on-icon-click=
"handleIconClick"
></el-autocomplete>
<style>
...
...
@@ -639,6 +641,9 @@ export default {
},
handleSelect
(
item
)
{
console
.
log
(
item
);
},
handleIconClick
(
ev
)
{
console
.
log
(
ev
);
}
},
mounted
()
{
...
...
@@ -792,7 +797,7 @@ export default {
| fetch-suggestions | 返回输入建议的方法,仅当你的输入建议数据 resolve 时,通过调用 callback(data:
[]
) 来返回它 | Function(queryString, callback) | — | — |
| popper-class | Autocomplete 下拉列表的类名 | string | — | — |
| trigger-on-focus | 是否在输入框 focus 时显示建议列表 | boolean | — | true |
| on-icon-click | 点击
Input 内的图标的钩子
函数 | function | — | — |
| on-icon-click | 点击
图标的回调
函数 | function | — | — |
| icon | 输入框尾部图标 | string | — | — |
### Autocomplete Events
...
...
packages/carousel/src/main.vue
View file @
3f64571f
...
...
@@ -96,6 +96,10 @@ export default {
},
watch
:
{
items
()
{
this
.
setActiveItem
(
0
);
},
activeIndex
(
val
,
oldVal
)
{
this
.
resetItemPosition
();
this
.
$emit
(
'
change
'
,
val
,
oldVal
);
...
...
@@ -139,11 +143,9 @@ export default {
});
},
handleItemChange
()
{
debounce
(
100
,
()
=>
{
this
.
updateItems
();
});
},
handleItemChange
:
debounce
(
100
,
function
()
{
this
.
updateItems
();
}),
updateItems
()
{
this
.
items
=
this
.
$children
.
filter
(
child
=>
child
.
$options
.
name
===
'
ElCarouselItem
'
);
...
...
test/unit/specs/carousel.spec.js
View file @
3f64571f
...
...
@@ -110,7 +110,7 @@ describe('Carousel', () => {
expect
(
vm
.
val
).
to
.
equal
(
1
);
expect
(
vm
.
oldVal
).
to
.
equal
(
0
);
done
();
},
10
0
);
},
6
0
);
});
describe
(
'
manual control
'
,
()
=>
{
...
...
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