gpt4 book ai didi

vue.js - 如何将插槽和插槽范围移动到 vue 3 v-slot 规则

转载 作者:行者123 更新时间:2023-12-02 02:08:53 25 4
gpt4 key购买 nike

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

<template slot="name" slot-scope="name"> {{ name.first }} {{ name.last }} </template>

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

<template v-slot:name v-slot="name"> {{ name.first }} {{ name.last }} </template>

enter image description here

最佳答案

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

<template v-slot:name v-slot="name"> {{ name.first }} {{ name.last }} </template>
^^^^^^^^^^^ ^^^^^^^^^^^^^

这是正确的解决方法:

<template v-slot:name="name"> {{ name.first }} {{ name.last }} </template>

关于vue.js - 如何将插槽和插槽范围移动到 vue 3 v-slot 规则,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67987624/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com