首页 > 其他 > 详细

vue3.x+element-plus [Vue warn]信息

时间:2021-06-04 18:00:44      阅读:216      评论:0      收藏:0      [点我收藏+]

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

vue3.x+element-plus [Vue warn]信息

原文:https://www.cnblogs.com/99aying/p/14850351.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!