⊗jsvuPmCmPAT 60 of 72 menu

Passing Any Type of Data to Vue

You can pass not only strings and numbers to child components, but also data of any type. To do this, you need to bind the attribute via the v-bind directive or its shortened form.

Let's pass an array as an example:

<template> <User :arg="[1, 2, 3]" /> </template>

Now let's pass the object:

<template> <User :arg="{a: 1, b: 2, c: 3}" /> </template>

Now let's pass a logical value:

<template> <User :arg="true" /> </template>

Pass an array to the child component. Output the elements of this array as a ul list.

enru