D
D
dk-web2019-04-22 06:13:37
Vue.js
dk-web, 2019-04-22 06:13:37

Why are vue components not isolated in this case?

Good day.
Actually there is a component - loading of a photo.
I replicate it in 4 copies

<lap-view :side="'/11.png'"></lap-view>
    <lap-view :side="'/12.png'"></lap-view>
    <lap-view :side="'/13.png'"></lap-view>
    <lap-view :side="'/13.png'"></lap-view>

I send a link to the image - in fact, this is what they differ in.
I display in the component
<img :src="side" class="dressImg">
      <div class="resizable2" :style="{ 'background-image': 'url(' + image + ')' }">
          </div>

data as it says in the docs is a function.
export default {
  name: "lapview",
  props: ["side"],
  data() {
    return {
        image: ""
    };
  }

Basically - I'm uploading a photo.. but everything goes into the first component.
I also noticed that my data attributes disappeared in my application ... usually vue puts down ... div data="abracadabra"
What could be the reason?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question