+
+ { this.$slots.content || this.content }
+
+ );
+
+ if (!this.$slots.default) return this.$slots.default;
+
+ const vnode = this.$slots.default[0];
+ const data = vnode.data = vnode.data || {};
+ const on = vnode.data.on = vnode.data.on || {};
+
+ on.mouseenter = this.addEventHandle(on.mouseenter, this.handleShowPopper);
+ on.mouseleave = this.addEventHandle(on.mouseleave, this.handleClosePopper);
+ data.staticClass = this.concatClass(data.staticClass, 'el-tooltip');
+
+ return vnode;
+ },
+
+ mounted() {
+ this.referenceElm = this.$el;
+ },
+
+ methods: {
+ addEventHandle(old, fn) {
+ return old ? Array.isArray(old) ? old.concat(fn) : [old, fn] : fn;
+ },
+
+ concatClass(a, b) {
+ return a ? b ? (a + ' ' + b) : a : (b || '');
+ },
+
+ handleShowPopper() {
+ if (this.manual) return;
+ clearTimeout(this.timeout);
+ this.timeout = setTimeout(() => {
+ this.showPopper = true;
+ }, this.openDelay);
+ },
+
+ handleClosePopper() {
+ if (this.manual) return;
+ clearTimeout(this.timeout);
+ this.showPopper = false;
+ }
+ }
+};
diff --git a/packages/tooltip/src/main.vue b/packages/tooltip/src/main.vue
deleted file mode 100644
index a0c6d1582..000000000
--- a/packages/tooltip/src/main.vue
+++ /dev/null
@@ -1,75 +0,0 @@
-