yijin
yijin

Reputation: 61

Slot scope with multi parameters

When I tried to use two parameters in vue slot scope, I can't find any example about it. When I use the following code to achieve my needs, it will report a parsing error

<template v-slot:name="text, record">
    <div>{{record.name}}</div>
    <div>{{record.short_name}}</div>
</template>

Upvotes: 6

Views: 11637

Answers (1)

Blitz
Blitz

Reputation: 500

In the parent you should use v-bind to pass props.

In the child component you can use destructuring.

Upvotes: 17

Related Questions