Answer the question
In order to leave comments, you need to log in
How to correctly pass PROPS to VUE.js?
This code throws an error. That the variable whichScreen is not defined. Help me please
export default {
props:{
elem:{
type:Object,
required: true,
},whichScreen:whichScreen
},
Answer the question
In order to leave comments, you need to log in
whichScreen:whichScreen and what is it in general?)
elem:{
type:Object,
required: true,
},
whichScreen: {
описание
}
First, for objects, a key must be defined in which the function returns an empty object (or not empty).
In your case, you need to decide what type whichScreen will have, judging by the naming, this is a string / numberdefault: () => ({})
props:{
elem:{
type:Object,
default: () => ({}),
required: true,
},
whichScreen: {
type: [String, Number]
// Остальные параметры по ситуации.
}
},
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question