一思同学 2024-01-24 14:33 采纳率: 0%
浏览 39
已结题

谁解决这个问题啊。Cannot read properties of undefined (reading 'type')vue

这个是缩减之后的代码,使用vite运行,提示的错误是:Cannot read properties of undefined (reading 'type')vue,如果把 “#[key]="{ row, rowIndex, column }"“ 删掉就没有问题了。

<template>
    <div class="n_table">
        <div class="table_content"><template v-for="item in columns" :key="item.dataIndex"><template
                    v-for="(value, key) in $slots" :key="key"><template v-if="item.dataIndex === key"
                        #[key]="{ row, rowIndex, column }">
                        <slot :name="key" :row="row" :rowIndex="rowIndex" :column="column"></slot>
                    </template>
                </template>
            </template>
        </div>
    </div>
</template>

<script setup>
import { ref, useSlots } from 'vue';
const props = defineProps({
    // 表格列配置
    columns: {
        type: Array,
        default: () => [],
    },
})
const slots = ref({});
slots.value = useSlots()
</script>


img

  • 写回答

17条回答 默认 最新

  • 一思同学 2024-01-24 14:51
    关注

    感谢你们的回复。但是不要用ai回答好吗。我已经在google chatgpt == 都问过了。

    img

    评论

报告相同问题?

问题事件

  • 系统已结题 2月1日
  • 修改了问题 1月24日
  • 创建了问题 1月24日

悬赏问题

  • ¥15 有偿求苍穹外卖环境配置
  • ¥15 代码在keil5里变成了这样怎么办啊,文件图像也变了,
  • ¥20 Ue4.26打包win64bit报错,如何解决?(语言-c++)
  • ¥15 clousx6整点报时指令怎么写
  • ¥30 远程帮我安装软件及库文件
  • ¥15 关于#自动化#的问题:如何通过电脑控制多相机同步拍照或摄影(相机或者摄影模组数量大于60),并将所有采集的照片或视频以一定编码规则存放至规定电脑文件夹内
  • ¥20 深信服vpn-2050这台设备如何配置才能成功联网?
  • ¥15 Arduino的wifi连接,如何关闭低功耗模式?
  • ¥15 Android studio 无法定位adb是什么问题?
  • ¥15 C#连接不上服务器,