M
M
Max99992020-08-21 19:58:37
Vue.js
Max9999, 2020-08-21 19:58:37

Hang a handler on a hidden element?

Good evening.
There is a hidden v-if block (I can't use v-show here). It has an element with a tooltip from materializecss. Because element hidden on load tooltip doesn't work. There is a method that changes the visibility of the block, but the tooltip initialization does not work in it...

active(el){
this.viz=true
M.Tooltip.init( this.$refs.el, {enterDelay: 400})
}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Aetae, 2020-08-22
@Max9999

There are many ways to do this with different nastiness, but the correct method is to make a wrapper component, which will hang all the necessary functionality inside itself.
The most primitive example:

Vue.component('m-tooltip', {
  mounted() {
    const tooltip = M.Tooltip.init(this.$el, {enterDelay: 400});
    this.$once('hook:beforeDestroy', () => tooltip.destroy());
  },
  render() {
    return this.$slots.default
  }
})
If you need something more - you can always complicate.

G
ggrelaxi, 2015-08-25
@ggrelaxi

Here the author indicated many ways to change the IP address
https://techprofi.com/network/kak-smenit-ip-adres/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question