Cannot read properties of undefined (reading ‘row‘)

简介: Cannot read properties of undefined (reading ‘row‘)

今天敲代码遇到了一个bug

自己原先的代码:

 <el-table-column
                    align="right">
                    
                        <el-button
                              type="primary"
                              plain
                              style="width: 50px; font-size: 13px"
                              >修改</el-button
                            >
                            <el-popconfirm
                                confirmButtonText="好的"
                                cancelButtonText="不用了"
                                icon="el-icon-info"
                                iconColor="red"
                                @confirm="deleteStudent(scope.row.id)"
                                title="这是一段内容确定删除吗?">
                            <template #reference>
                        <el-button type="danger">删除</el-button>
                        </template>
                    </el-popconfirm>
                <!-- </template><template v-slot="scope"></template> -->
         </el-table-column>

改好的代码:

<el-table-column
                    align="right">
                    <template v-slot="scope"><el-button
                              type="primary"
                              plain
                              style="width: 50px; font-size: 13px"
                              >修改</el-button
                            >
                            <el-popconfirm
                                confirmButtonText="好的"
                                cancelButtonText="不用了"
                                icon="el-icon-info"
                                iconColor="red"
                                @confirm="deleteStudent(scope.row.id)"
                                title="这是一段内容确定删除吗?">
                            <template #reference>
                        <el-button type="danger">删除</el-button>
                        </template>
                    </el-popconfirm>
                </template>

<template v-slot="scope">将template的标签改成这样


相关文章
TypeError: Cannot set properties of undefined (setting ‘resdata‘),res定义数据出现的问题,定义的方法用this换成that
TypeError: Cannot set properties of undefined (setting ‘resdata‘),res定义数据出现的问题,定义的方法用this换成that
Cannot read properties of undefined (reading ‘post‘)
Cannot read properties of undefined (reading ‘post‘)
|
18天前
|
前端开发 小程序 JavaScript
微信小程序-Unhandled promise rejection TypeError: Cannot read property ‘get‘ of undefined
微信小程序-Unhandled promise rejection TypeError: Cannot read property ‘get‘ of undefined
|
2月前
|
资源调度 前端开发
编译第三方前端项目时候出现Syntax Error: TypeError: Cannot set properties of undefined (setting ‘parent‘)
编译第三方前端项目时候出现Syntax Error: TypeError: Cannot set properties of undefined (setting ‘parent‘)
192 0
|
11天前
|
JavaScript
element-ui Cannot read properties of undefined (reading ‘name‘),data中写成集合的形式
element-ui Cannot read properties of undefined (reading ‘name‘),data中写成集合的形式
|
11天前
|
JavaScript
Cannot read properties of undefined (reading ‘$router‘)
Cannot read properties of undefined (reading ‘$router‘)
Cannot read properties of undefined (reading ‘username‘),粗心惹的祸,数据都不知道写呢了,
Cannot read properties of undefined (reading ‘username‘),粗心惹的祸,数据都不知道写呢了,
|
12天前
|
JavaScript 前端开发
报错:Cannot read properties of undefined (reading ‘$message‘)解决方法
以上就是解决"Cannot read properties of undefined (reading ‘$message‘)"错误的几种方法,希望对你有所帮助。
80 0
Cannot read properties of undefined (reading ‘use‘)-------编程版本问题
Cannot read properties of undefined (reading ‘use‘)-------编程版本问题
|
17天前
|
关系型数据库 MySQL Serverless
函数计算操作报错合集之当遇到“Cannot read properties of undefined(reading 'props')”错误,该怎么处理
在使用函数计算服务(如阿里云函数计算)时,用户可能会遇到多种错误场景。以下是一些常见的操作报错及其可能的原因和解决方法,包括但不限于:1. 函数部署失败、2. 函数执行超时、3. 资源不足错误、4. 权限与访问错误、5. 依赖问题、6. 网络配置错误、7. 触发器配置错误、8. 日志与监控问题。