Set default tooltip properties using UMD



  • I’m looking for a way to set default tooltip properties using UMD. When using the CLI version I do it as follows:

    import { QTooltip } from 'quasar';
    QTooltip.options.props.delay.default = 550;
    

    Now I have a UMD project and I want to do the same. However there is no equivalent of this.$q.notify.setDefaults(...) (which I use to set Notify defaults) because there is no this.$q.tooltip object. How to do it?

    P.S. I think a similar issue was raised here but it was closed soon afterwards.



  • @rubs UMD exposes a Quasar object, console log that. It should be there. https://quasar.dev/start/umd#Quasar-Global-Object

    In the GitHub issues you mentioned, as answered there, you can wrap the components or use extend and set the props you want to change its defaults.



  • Great answer, thanks for the quick solution.



  • Thanks to your tip, here’s the resulting code, complete with Intellisense:

    /** @type {quasar.QTooltip} */
    const tooltipProps = QTooltip.options.props;
    tooltipProps.delay.default = 550;
    

Log in to reply