Skip to content

[Question] How can I use v-slots to get parameters in the slot? #482

Open
@CNMathon

Description

@CNMathon

🧐 Problem Description

I can not use v-slots to get parameters in the slot.

💻 Sample code

<ComponentA>
  v-slots={{
    sex: (record) => {
      <>{ record.sex === 0 ? 'male' : 'famale' }</>    // I can't get the "record".
    }
  }}
</ComponentA>

🚑 Other information

This is the code using the Vue template syntax. It is works.

<template>
  <ComponentA>
    <template #sex="{ record }">
      {{ record.sex === 0 ? 'male' : 'famale' }}    <!-- It is works. -->
    </template>
  </ComponentA>
</template>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions