M
M
Maxim Timofeev2018-08-29 16:38:00
Vue.js
Maxim Timofeev, 2018-08-29 16:38:00

How to cancel render in vue&?

I make a kind of tabs, from a child element, I call the parent method, which **does not matter much** while I need the child itself to not form html. Can't figure out how to do it better?

mounted: function () {
      let tab = {
        title: this.title,
        content: this.$el.innerHTML
      };
      this.$parent.addTab(tab);
    },

that is, you need to cancel the render.
And if anyone knows how to get data from
<slot></slot>more elegant (more correct) than this.$el.innerHTML- in general, I will say thanks

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anton Anton, 2018-08-29
@Fragster

why not insert the component into the parent instead of this perverted html copy?

V
Vladimir Proskurin, 2018-08-29
@Vlad_IT

It's not very clear what you want to do. Do you want to extract html from a child component, and so that the component does not draw this html? It seems to me that this is not possible. And I don't think that's right.
Maybe then you don't need to use this child component, but just draw this html in the parent?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question