Fix all JS and Vue errors in tooltip
This commit is contained in:
parent
759096b8c4
commit
4761d7a44c
@ -14,24 +14,23 @@ const longPressTimeout = 1000;
|
|||||||
export class TooltipComponent extends Vue {
|
export class TooltipComponent extends Vue {
|
||||||
@Prop({ type: String, default: "auto" }) public placement: string;
|
@Prop({ type: String, default: "auto" }) public placement: string;
|
||||||
@Prop({ type: Number, default: 200 }) public delay: number;
|
@Prop({ type: Number, default: 200 }) public delay: number;
|
||||||
@Prop({ type: Array, default: ["hover", "focus"]}) public triggers: Trigger[];
|
@Prop({ type: Array, default: () => ["hover", "focus"]}) public triggers: Trigger[];
|
||||||
|
|
||||||
public show: boolean = false;
|
public show: boolean = false;
|
||||||
public root: Element = null;
|
public root: Element = null;
|
||||||
|
|
||||||
private _events: Events;
|
private _events: Events = {};
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
this.root = (this.$refs['root'] as HTMLSpanElement).parentElement;
|
this.root = (this.$refs['root'] as HTMLSpanElement).parentElement;
|
||||||
|
this.updateTriggers();
|
||||||
this._registerEventListeners();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
this._removeEventListeners();
|
this._removeEventListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Watch('triggers', { immediate: true })
|
@Watch('triggers')
|
||||||
updateTriggers() {
|
updateTriggers() {
|
||||||
this._removeEventListeners();
|
this._removeEventListeners();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user