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
f457cd7f
Commit
f457cd7f
authored
Sep 25, 2017
by
Leopoldthecoder
Committed by
杨奕
Sep 25, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tooltip: fix disabled tooltip affecting other instances
parent
1552f875
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
14 deletions
+33
-14
examples/components/side-nav.vue
examples/components/side-nav.vue
+5
-0
examples/docs/zh-CN/table.md
examples/docs/zh-CN/table.md
+5
-5
examples/index.tpl
examples/index.tpl
+1
-0
packages/tooltip/src/main.js
packages/tooltip/src/main.js
+22
-9
No files found.
examples/components/side-nav.vue
View file @
f457cd7f
...
...
@@ -91,6 +91,10 @@
line-height
:
26px
;
margin-top
:
10px
;
}
#code-sponsor-widget
{
margin
:
50px
0
0
-20px
;
}
}
.nav-dropdown-list
{
width
:
120px
;
...
...
@@ -165,6 +169,7 @@
</
template
>
</li>
</ul>
<div
id=
"code-sponsor-widget"
></div>
</div>
</template>
<
script
>
...
...
examples/docs/zh-CN/table.md
View file @
f457cd7f
...
...
@@ -270,8 +270,8 @@
}
},
handleClick() {
console.log(
'click'
);
handleClick(
row
) {
console.log(
row
);
},
handleEdit(index, row) {
...
...
@@ -707,7 +707,7 @@
label=
"操作"
width=
"100"
>
<template
scope=
"scope"
>
<el-button
@
click=
"handleClick"
type=
"text"
size=
"small"
>
查看
</el-button>
<el-button
@
click=
"handleClick
(scope.row)
"
type=
"text"
size=
"small"
>
查看
</el-button>
<el-button
type=
"text"
size=
"small"
>
编辑
</el-button>
</template>
</el-table-column>
...
...
@@ -717,8 +717,8 @@
<script>
export
default
{
methods
:
{
handleClick
()
{
console
.
log
(
1
);
handleClick
(
row
)
{
console
.
log
(
row
);
}
},
...
...
examples/index.tpl
View file @
f457cd7f
...
...
@@ -9,6 +9,7 @@
</head>
<body>
<div
id=
"app"
></div><
%
if
(process.env.NODE_ENV =
==
'
production
')
{
%
>
<script
src=
"https://app.codesponsor.io/scripts/qFcVkt4f3DQEg4zrwINGVg?theme=light&height=250&width=240"
></script>
<script
src=
"//cdn.jsdelivr.net/npm/vue@2.3.0/dist/vue.runtime.min.js"
></script>
<script
src=
"//cdn.jsdelivr.net/npm/vue-router@2.1.1/dist/vue-router.min.js"
></script><
%
}
%
>
</body>
...
...
packages/tooltip/src/main.js
View file @
f457cd7f
...
...
@@ -48,8 +48,7 @@ export default {
data
()
{
return
{
timeoutPending
:
null
,
handlerAdded
:
false
timeoutPending
:
null
};
},
...
...
@@ -94,11 +93,10 @@ export default {
const
nativeOn
=
vnode
.
data
.
nativeOn
=
vnode
.
data
.
nativeOn
||
{};
data
.
staticClass
=
this
.
concatClass
(
data
.
staticClass
,
'
el-tooltip
'
);
if
(
this
.
handlerAdded
)
return
vnode
;
on
.
mouseenter
=
this
.
addEventHandle
(
on
.
mouseenter
,
()
=>
{
this
.
setExpectedState
(
true
);
this
.
handleShowPopper
();
});
on
.
mouseleave
=
this
.
addEventHandle
(
on
.
mouseleave
,
()
=>
{
this
.
setExpectedState
(
false
);
this
.
debounceClose
();
});
nativeOn
.
mouseenter
=
this
.
addEventHandle
(
nativeOn
.
mouseenter
,
()
=>
{
this
.
setExpectedState
(
true
);
this
.
handleShowPopper
();
});
nativeOn
.
mouseleave
=
this
.
addEventHandle
(
nativeOn
.
mouseleave
,
()
=>
{
this
.
setExpectedState
(
false
);
this
.
debounceClose
();
});
on
.
mouseenter
=
this
.
addEventHandle
(
on
.
mouseenter
,
this
.
show
);
on
.
mouseleave
=
this
.
addEventHandle
(
on
.
mouseleave
,
this
.
hide
);
nativeOn
.
mouseenter
=
this
.
addEventHandle
(
nativeOn
.
mouseenter
,
this
.
show
);
nativeOn
.
mouseleave
=
this
.
addEventHandle
(
nativeOn
.
mouseleave
,
this
.
hide
);
return
vnode
;
},
...
...
@@ -108,9 +106,24 @@ export default {
},
methods
:
{
show
()
{
this
.
setExpectedState
(
true
);
this
.
handleShowPopper
();
},
hide
()
{
this
.
setExpectedState
(
false
);
this
.
debounceClose
();
},
addEventHandle
(
old
,
fn
)
{
this
.
handlerAdded
=
true
;
return
old
?
Array
.
isArray
(
old
)
?
old
.
concat
(
fn
)
:
[
old
,
fn
]
:
fn
;
if
(
!
old
)
{
return
fn
;
}
else
if
(
Array
.
isArray
(
old
))
{
return
old
.
indexOf
(
fn
)
>
-
1
?
old
:
old
.
concat
(
fn
);
}
else
{
return
old
===
fn
?
old
:
[
old
,
fn
];
}
},
concatClass
(
a
,
b
)
{
...
...
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