A
A
Alianos2021-04-30 18:32:51
Vue.js
Alianos, 2021-04-30 18:32:51

How to create v-on: events?

Hello, I can write a directive v-transitionendand assign to it, for example, such code

transitionend: {
      inserted(el, binding, vnode) {
        el.addEventListener("transitionend", () => {
          if (!vnode.context.isDropped) vnode.context.focusedObj = null;
        });
      },
    },

But how to make it so that instead v-transitionendI can write , that is, so that the processing code can be put not in a directive, but in a method @transitionend="mymethod()"

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Aetae, 2021-05-01
@Alianos

What are you sticking to these directives. Directives are a niche feature, needed in specific general cases. If you write a directive for one component, you are doing something wrong (99%).
So it should work on its own, without unnecessary gestures. As a last resort, if the target is another component. @transitionend="mymethod"@transitionend.native="mymethod"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question