当前位置: 首页 > news >正文

开发避坑短篇(9):解决升级Vue3后slot attributes废弃警告

报错信息

`slot` attributes are deprecated 

异常分析

在Vue3中,使用slot和slot-scope属性来指定插槽内容已经被废弃。在Vue2中,这是定义插槽的主要方式。Vue3推荐使用标签和v-slot指令来代替这两个属性。

解决办法

Vue2中的写法

<span slot="footer" class="dialog-footer"><el-button type="primary" @click="submit" :loading="loading">提交</el-button><el-button type="primary" @click="save">保存</el-button><el-button @click="closeApply">取消</el-button>
</span>

Vue3中的写法

<template v-slot:footer><div class="dialog-footer"><el-button type="primary" @click="submit" :loading="loading">提交</el-button><el-button type="primary" @click="save">保存</el-button><el-button @click="closeApply">取消</el-button></div>
</template>
http://www.lryc.cn/news/604691.html

相关文章:

  • 从黑箱到理解模型为什么(模型可解释性与特征重要性分析)
  • 力扣54:螺旋矩阵
  • git rebase 操作记录
  • 《Java 程序设计》第 11 章 - 泛型与集合
  • chukonu阅读笔记(2)
  • 【LY88】双系统指南及避坑
  • 阿里云AI代码助手通义灵码开发指导
  • 【读书笔记】设计数据密集型应用 DDIA 第三章:存储与检索
  • OPCap:Object-aware Prompting Captioning
  • PHP/Java/Python实现:如何有效防止恶意文件上传
  • 【Qt开发】信号与槽(三)-> 自定义信号和槽
  • <RT1176系列13>LWIP概念介绍
  • 游戏盾是如何做到免疫攻击的
  • Spring Cloud Gateway Server Web MVC报错“Unsupported transfer encoding: chunked”解决
  • 离线录像文件视频AI分析解决方案
  • android 性能优化
  • 密码学安全性简介
  • 深入浅出:在 Spring Boot 中构建实时应用 - 全面掌握 WebSocket
  • 电池自动生产线:科技赋能下的高效制造新范式
  • Ubuntu LNMP
  • MCU中的CAN总线是什么?
  • 44、鸿蒙HarmonyOS Next开发:视频播放 (Video)组件和进度条 (Progress)组件的使用
  • LLM—— 基于 MCP 协议(SSE 模式)的工具调用实践
  • 常见的cms框架的webshell方法
  • JAVAEE--4.多线程案例
  • 机器学习之线性回归的入门学习
  • SpringBoot学习 |springboot概念+微服务架构
  • 【HarmonyOS】鸿蒙ArkWeb加载优化方案详解
  • 相亲小程序匹配与推荐系统模块搭建
  • Redis知识点(2)