C
C
colorkid2017-04-27 06:39:38
JavaScript
colorkid, 2017-04-27 06:39:38

IMG tag as a vue component. Is this generally correct?

Hello. I started to study vue js, made a slider for an example, everything is ok. I started to deal with the components, I decided to remake the slider on the components, and then a question arose. There is an IMG tag there, I make it a component, but it goes in my DOM as a double tag. I'm wondering if it's correct to specify the img tag as a component?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Negwereth, 2017-04-27
@colorkid

No, since the component implies content that cannot physically be in img.
Plus, Vue treats component tags as custom tags, i.e. ones that are not in the spec. That's why it adds a closing tag.

E
Evgeny Kulakov, 2017-04-27
@kulakoff Vue.js

It feels weird. Please provide an example code.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question