DawgOnKing
128
3
Vue

Handling Array Validation failure in Vue

Posted 4 weeks ago by DawgOnKing
{
message: "The given data was invalid.",
errors: {
    hubs: [
        "The hubs field is required."
    ]
}
}

Is handled in Vue with:

v-if="feedback.hubs">{{ feedback.hubs[0] }}

But how do I handle the following to display similar errors in Vue:

{
message: "The given data was invalid.",
errors: {
        hubs.0: [
            "The hubs.0 must be 3 characters."
        ],
        hubs.1: [
            "The hubs.1 must be 3 characters."
        ],
        hubs.2: [
"The hubs.2 must be 3 characters."
]
}
}

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