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

小型服务器做网站wordpress表单支付插件下载

小型服务器做网站,wordpress表单支付插件下载,代理平台盈利模式,公司注册资金可以乱写吗el-upload组件 支持多种风格,如文件列表,图片,图片卡片,支持多种事件,预览,删除,上传成功,上传中等钩子。 file-list:上传的文件集合,一定要用v-model:file-…

el-upload组件 支持多种风格,如文件列表,图片,图片卡片,支持多种事件,预览,删除,上传成功,上传中等钩子。
在这里插入图片描述

在这里插入图片描述
file-list:上传的文件集合,一定要用v-model:file-list进行双向绑定。
list-type:决定文件类型,filelist,picture,picture-card 3种

用法示例

vue代码

<script setup lang="ts">
import { onMounted, reactive, ref } from 'vue'
import type { FormInstance,FormRules,UploadUserFile  } from 'element-plus'interface Good {}const goodForm=ref<Good>({});const fileList=ref<UploadUserFile[]>()const picFileList=ref<UploadUserFile[]>()const picCardFileList=ref<UploadUserFile[]>()const previewDialogVisable=ref(false)
const previewPicUrl=ref()const previewFunc = (uploadFile:UploadUserFile)=>{previewDialogVisable.value=truepreviewPicUrl.value=uploadFile.url
}</script><template><el-form :model="goodForm" status-icon label-position="left" label-width="auto" ref="formRef"><el-form-item label="select file"><el-upload v-model:file-list="fileList" action="http://localhost:3000/upload"><template #trigger><el-button type="primary">select file</el-button></template></el-upload></el-form-item><el-form-item label="select pic file"><el-upload v-model:file-list="picFileList" list-type="picture" action="http://localhost:3000/upload"><template #trigger><el-button type="primary">select file</el-button></template></el-upload></el-form-item><el-form-item label="picture card file"><el-upload v-model:file-list="picCardFileList" action="http://localhost:3000/upload" list-type="picture-card" :on-preview="previewFunc"><template #trigger><el-button type="primary">select file</el-button></template></el-upload></el-form-item><el-dialog v-model="previewDialogVisable" ><img :src="previewPicUrl"  alt="preview image" w-full/></el-dialog></el-form></template><style scoped></style>

后端用node+ts

import express from 'express';
import multer from 'multer';
import path from 'path';
import cors from 'cors';// 初始化 express 应用
const app = express();app.use(cors())// 设置文件存储配置
const storage = multer.diskStorage({destination: (req, file, cb) => {cb(null, 'uploads/'); // 文件存储目录},filename: (req, file, cb) => {const uniqueSuffix = Date.now() + '-' + Math.round(Math.random() * 1E9);cb(null, file.fieldname + '-' + uniqueSuffix + path.extname(file.originalname)); // 文件名}
});const upload = multer({ storage: storage });// 创建文件上传路由
app.post('/upload', upload.single('file'), (req, res) => {res.send({message: 'File uploaded successfully',file: req.file});
});app.use(express.static(path.join(__dirname, '../uploads')));// 启动服务器
const PORT = 3000;
app.listen(PORT, () => {console.log(`Server is running on http://localhost:${PORT}`);
});

在这里插入图片描述

demo 地址
https://github.com/haozhi-ly/elment-plus-demo

https://element-plus.org/zh-CN/component/upload.html#%E5%B1%9E%E6%80%A7

http://www.yayakq.cn/news/860554/

相关文章:

  • 公司做网站需要几个人网站加载速度
  • 汕尾招聘 网站建设合伙人flash同视频做网站
  • 东营网站建设那家好库房出入库管理软件
  • 网站推广公司电话云浮市住房和城乡建设局网站
  • nginx即代理又做网站wordpress全站静态页面
  • 彩票计划网站怎么做798艺术区个人拍照图片及价格
  • 免费做电脑网站商城网站建设合同范本
  • 写作网站保底和全勤的区别网站搭建详细流程
  • 网站快速优化排名推荐天猫优惠卷怎么做网站
  • 中小型网站建设新闻网站建设网页设计师
  • 深圳建网站兴田德润可信企业做网站需要花多少钱
  • 个人备案的网站可以卖东西么drupal个人门户网站开发
  • 网站开发与维修是什么意思游戏网站app
  • 产品经理兼职做网站报酬建设网站时以什么为导向
  • 网站数据库要多大深圳网站建设运营公司
  • 加强网站建设的措施网站开发项目流程设计
  • 成都网站设计的公司深圳的装修公司排名
  • 徐州市徐州市城乡建设局网站首页网页设计地址
  • 网站付款链接怎么做的微信朋友圈广告如何投放
  • 网站开发需要掌握的知识国内最新重大新闻
  • 长沙建站挺找有为太极大同网站建设熊掌号
  • 河北省和城乡住房建设厅网站wordpress搭建注册会员
  • 专业网站建设公司兴田德润信任高滨海营销型网站建设
  • 承接婚庆公司网站建设公司名字大全参考2022
  • 石桥铺网站建设公司保定网站制作报价
  • 做网站时怎样图片上传怎么才能让图片不变形有什么插件吗网站源码下载免费
  • 深圳的网站建设公司电话有没有什么好看的网址
  • 佛山信息技术网站开发搬瓦工ss加wordpress
  • 大连网站建设选高合科技微商如何做网站引流
  • 南通外贸网站推广wordpress 权限破解