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

【Element-plus】vue组合式中使用el-upload通过oss接口上传图片流程(可直接复制使用)

Html

        <el-upload:action=ossUrl:on-success="handleImgSuccess":headers="{Authorization:token}"><el-icon><Plus /></el-icon>点击上传图片</el-upload>

JS

const ossUrl = ref("")
ossUrl.value = 【你的ossUrl】
const loginStore = useLoginStore();
const token = 【你的token】     // 如果没有可以忽略
const handleImgSuccess = (response) => {console.log(response)if (response.code === 200) {【你的imgUrl】 = response.data.url}
}

http://www.lryc.cn/news/355549.html

相关文章:

  • C++ 数据结构算法 学习笔记(33) -查找算法及企业级应用
  • 【Linux】在Ubuntu 16.04上安装Gerrit + PostgreSQL + Apache服务
  • 数据倾斜那些事儿
  • python考试成绩管理与分析:从列表到方差
  • Excel某列中有不连续的数据,怎么提取数据到新的列?
  • 翻译《The Old New Thing》- What does it mean when a display change is temporary?
  • 【C语言】char,short char,long char分别是多少字节,多少位,多少bit
  • 新V 系首批订单交付!苏州金龙助新疆游骏文旅集团打造旅运新标杆
  • 【Django】从零开始学Django【2】
  • 【leetcode--383赎金信(使用Counter一行代码结束战斗)】
  • pdf打开方式怎么设置默认?分享这几种设置方法
  • 杂谈|RestFul和http的区别
  • Nginx的Sub模块
  • 使用大模型做应用的一些问题
  • 2024 前端面试每日1小时
  • 2024.05.22学习记录
  • Redis与数据库同步指南:订阅Binlog实现数据一致性
  • Spring MVC+mybatis 项目入门:旅游网(二) dispatcher与controller与Spring MVC
  • 深入了解数据库与Java数据类型映射
  • 深刻解析 volatile 关键字和线程本地存储ThreadLocal
  • 羧甲基纤维素钠(CMC-Na)市场规模不断增长 我国生产企业众多
  • 网红郭有才是怎么火起来的
  • 小米8SE刷root(面具)
  • 如果创办Google
  • 邦芒职场:揭秘影响你职场收入的九大细节
  • Petalinux 制作ZYNQ镜像文件流程
  • 99%的人都不知道,微信才是真正的学习神器
  • 加速模型训练 GPU cudnn
  • 《python编程从入门到实践》day40
  • IO多路复用学习笔记