Answer the question
In order to leave comments, you need to log in
Vue.js pass array to component?
I have a component with an array of images, I want to pass an array of their addresses (src) to it in "props".
In this case, the addresses will always be different, I don't want to pass a variable with addresses, but I want to write them in place
<post
avatar="./img/2.jpg"
imgSrc="['./img/3.jpg', './img/2.jpg']" //что тут написать?
name="Terrance arnold"
description="posted an updated"
online="active 14 minutes ago"
text="“Check if it can be corrected with overflow : hidden”"
></post>
props: {
avatar: String,
name: String,
description: String,
online: {
default: "Online",
type: String
},
imgSrc: {
type: Array,
default: function() {
return [];
}
},
title: String,
text: String
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question