vue3.x+element-plus [Vue warn]信息
最近需要把之前的vue2.x的项目迁移成3.x的,记录一下迁移过程中遇到的[Vue warn]信息,以便其他项目使用
- [Vue warn]: Missing required prop: "modelValue"
[Vue warn]: Extraneous non-props attributes (visible) were passed to component but could not be automatically inherited because component renders fragment or text root nodes.
<el-dialog
:title="'打开弹窗'"
v-model:visible="dialogFormVisible"
:close-on-click-modal="false"
>
</el-dialog>
v-model:visible="xxx"改为v-model="xxx"即可
<el-dialog
:title="'打开弹窗'"
v-model="dialogFormVisible"
:close-on-click-modal="false"
>
</el-dialog>
[Vue warn]: Extraneous non-props attributes (width) were passed to component but could not be automatically inherited because component renders fragment or text root nodes.
<el-popconfirm
width="200"
title="确定删除此条数据吗?"
@onConfirm="deleteRow(row.id)"
>
</el-popconfirm>
删除
width="xxx"
<el-popconfirm
title="确定删除此条数据吗?"
@onConfirm="deleteRow(row.id)"
>
</el-popconfirm>
- [Vue warn]: Extraneous non-emits event listeners (onConfirm) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.
<el-popconfirm
title="确定删除此条数据吗?"
@onConfirm="deleteRow(row.id)"
>
<template #reference>
<el-button type="primary" size="small" icon="el-icon-delete">删除</el-button>
</template>
</el-popconfirm>
将
@onConfirm改为@confirm
<el-popconfirm
title="确定删除此条数据吗?"
@confirm="deleteRow(row.id)"
>
<template #reference>
<el-button type="primary" size="small" icon="el-icon-delete">删除</el-button>
</template>
</el-popconfirm>
- [Vue warn]:Unhandled error during execution of render function ...
getList() {
请求方法({
参数名:参数值
}).then((res) => {
console.log("列表", res);
if (res.code === 200) {
this.list = res.data;
}
});
},
获取列表时,返回值赋值错误
getList() {
请求方法({
参数名:参数值
}).then((res) => {
console.log("列表", res);
if (res.code === 200) {
this.list = res.data.list;
}
});
},

浙公网安备 33010602011771号