7 months ago

Setting Vue data with props Object key, value

Posted 7 months ago by DawgOnKing

I'm passing data between components and this is the output:

props data:object


I want to set the first key, value pair as "selected":

data selected:object

mounted() {
    this.selected = Object.values(this.data) //first key,value only not entire object from left

When I console log:

console.log(Object.values(this.data)); // return empty array - same for Object.keys

I'm trying to set a default values when component loads carousel image + data is all. #failArmy

Please sign in or create an account to participate in this conversation.