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
1f2ee02b
Commit
1f2ee02b
authored
Aug 02, 2017
by
baiyaaaaa
Committed by
杨奕
Aug 13, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support dropdown placement
parent
dc7de86a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
11 deletions
+25
-11
examples/docs/en-US/dropdown.md
examples/docs/en-US/dropdown.md
+1
-1
examples/docs/zh-CN/dropdown.md
examples/docs/zh-CN/dropdown.md
+1
-1
packages/dropdown/src/dropdown-menu.vue
packages/dropdown/src/dropdown-menu.vue
+10
-2
packages/dropdown/src/dropdown.vue
packages/dropdown/src/dropdown.vue
+13
-7
No files found.
examples/docs/en-US/dropdown.md
View file @
1f2ee02b
...
...
@@ -207,7 +207,7 @@ Clicking each dropdown item fires an event whose parameter is assigned by each i
| size | menu button size, refer to
`Button`
Component, only works when
`split-button`
is true | string | — | — |
| split-button | whether a button group is displayed | boolean | — | false |
| size | component size, refer to
`Button`
component | string | large, small, mini | — |
|
menu-align | horizontal alignment | string | start/end |
end |
|
placement | placement of pop menu | string | top/top-start/top-end/bottom/bottom-start/bottom-end | bottom-
end |
| trigger | how to trigger | string | hover/click | hover |
| hide-on-click | whether to hide menu after clicking menu-item | boolean | — | true |
...
...
examples/docs/zh-CN/dropdown.md
View file @
1f2ee02b
...
...
@@ -207,7 +207,7 @@
| type | 菜单按钮类型,同 Button 组件(只在
`split-button`
为 true 的情况下有效) | string | — | — |
| size | 菜单按钮尺寸,同 Button 组件(只在
`split-button`
为 true 的情况下有效) | string | — | — |
| split-button | 下拉触发元素呈现为按钮组 | boolean | — | false |
|
menu-align | 菜单水平对齐方向 | string | start, end |
end |
|
placement | 菜单弹出位置 | string | top/top-start/top-end/bottom/bottom-start/bottom-end | bottom-
end |
| trigger | 触发下拉的行为 | string | hover, click | hover |
| hide-on-click | 是否在点击菜单项后隐藏菜单 | boolean | — | true |
...
...
packages/dropdown/src/dropdown-menu.vue
View file @
1f2ee02b
...
...
@@ -15,6 +15,14 @@
mixins
:
[
Popper
],
data
()
{
return
{
placement
:
this
.
dropdown
.
placement
};
},
inject
:
[
'
dropdown
'
],
created
()
{
this
.
$on
(
'
updatePopper
'
,
()
=>
{
if
(
this
.
showPopper
)
this
.
updatePopper
();
...
...
@@ -30,10 +38,10 @@
},
watch
:
{
'
$parent.menuAlign
'
:
{
'
dropdown.placement
'
:
{
immediate
:
true
,
handler
(
val
)
{
this
.
currentPlacement
=
`bottom-
${
val
}
`
;
this
.
currentPlacement
=
val
;
}
}
}
...
...
packages/dropdown/src/dropdown.vue
View file @
1f2ee02b
...
...
@@ -18,21 +18,27 @@
ElButtonGroup
},
provide
()
{
return
{
dropdown
:
this
};
},
props
:
{
trigger
:
{
type
:
String
,
default
:
'
hover
'
},
menuAlign
:
{
type
:
String
,
default
:
'
end
'
},
type
:
String
,
size
:
String
,
splitButton
:
Boolean
,
hideOnClick
:
{
type
:
Boolean
,
default
:
true
},
placement
:
{
type
:
String
,
default
:
'
bottom-end
'
}
},
...
...
@@ -100,14 +106,14 @@
render
(
h
)
{
let
{
hide
,
splitButton
,
type
,
size
}
=
this
;
var
handle
Click
=
_
=>
{
this
.
$emit
(
'
click
'
);
var
handle
MainButtonClick
=
(
event
)
=>
{
this
.
$emit
(
'
click
'
,
event
);
};
let
triggerElm
=
!
splitButton
?
this
.
$slots
.
default
:
(
<
el
-
button
-
group
>
<
el
-
button
type
=
{
type
}
size
=
{
size
}
nativeOn
-
click
=
{
handleClick
}
>
<
el
-
button
type
=
{
type
}
size
=
{
size
}
nativeOn
-
click
=
{
handle
MainButton
Click
}
>
{
this
.
$slots
.
default
}
<
/el-button
>
<
el
-
button
ref
=
"
trigger
"
type
=
{
type
}
size
=
{
size
}
class
=
"
el-dropdown__caret-button
"
>
...
...
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