Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix of "options" unavailable issue #720

Open
wants to merge 1 commit into
base: old
Choose a base branch
from
Open

Conversation

rx-837
Copy link

@rx-837 rx-837 commented May 20, 2021

As can I see property "options" is declared in interface "GlobalVTooltip" types/index.d.ts:

export interface GlobalVTooltip {
  enabled?: boolean
  options?: Partial<GlobalVTooltipOptions>
}

declare const vToolTip: PluginFunction<Partial<GlobalVTooltipOptions>> & GlobalVTooltip;
export default vToolTip;

but is lost in code src/index.js:

const plugin = {
  install,

  get enabled () {
    return state.enabled
  },

  set enabled (value) {
    state.enabled = value
  }

....

export default plugin
}

@Akryum
Copy link
Owner

Akryum commented Jun 23, 2021

@rx-837
Copy link
Author

rx-837 commented Jul 6, 2021

@Akryum omg... but it doesn't work

In my case i register only directive:

import Vue from "vue"
import vTooltip, { VTooltip } from "v-tooltip"

vTooltip.options.defaultHideOnTargetClick = false
Vue.directive("v-tooltip", VTooltip)

vTooltip.options is undefined and code is aborted with TypeError:

Uncaught TypeError: Cannot set property 'defaultHideOnTargetClick' of undefined

Quote from "README":

Or directly on package:

import VTooltip from 'v-tooltip'
VTooltip.options.defaultHtml = false

@rx-837
Copy link
Author

rx-837 commented Jul 6, 2021

@Akryum

my fix is similar to https://github.com/Akryum/v-tooltip/blob/master/src/directives/v-tooltip.js#L218

in this case object "plugin" have "options" property with link on "defaultOptions"

@rx-837
Copy link
Author

rx-837 commented Sep 7, 2021

@Akryum ping ping

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants