最近需要把之前的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;
}
});
},
