Tooltip: add manual feature

This commit is contained in:
qingwei.li
2016-10-22 17:48:44 +08:00
parent a4175a74e2
commit aef2e08159
3 changed files with 46 additions and 17 deletions

View File

@@ -33,6 +33,7 @@ export default {
default: 0
},
disabled: Boolean,
manual: Boolean,
effect: {
type: String,
default: 'dark'
@@ -57,12 +58,14 @@ export default {
methods: {
handleShowPopper() {
if (this.manual) return;
this.timeout = setTimeout(() => {
this.showPopper = true;
}, this.openDelay);
},
handleClosePopper() {
if (this.manual) return;
clearTimeout(this.timeout);
this.showPopper = false;
}