如何将 slot 和 slot-scope 移动到 vue 3 v-slot 规则

cly*_*don 4 vue.js vuejs2 vuejs3 ant-design-vue

当我使用VueJS 的Ant-design table时出现此错误

<template slot="name" slot-scope="name"> {{ name.first }} {{ name.last }} </template>
Run Code Online (Sandbox Code Playgroud)

我更改为 Vue 3 规则后仍然没有显示:

<template v-slot:name v-slot="name"> {{ name.first }} {{ name.last }} </template>
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

ton*_*y19 8

下面的标记不起作用,因为它用两个插槽名称标记模板;即,name槽 (in v-slot:name) 以及default槽 (in v-slot="name"):

<template v-slot:name v-slot="name"> {{ name.first }} {{ name.last }} </template>
          ^^^^^^^^^^^ ^^^^^^^^^^^^^
Run Code Online (Sandbox Code Playgroud)

这是正确的修复方法:

<template v-slot:name="name"> {{ name.first }} {{ name.last }} </template>
Run Code Online (Sandbox Code Playgroud)