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

全球可以做外贸的社交网站网站安全检测

全球可以做外贸的社交网站,网站安全检测,网站百度地图,手怎么搭建网站文章目录 使用场景页面效果前端代码 使用场景 vue2 element 表单提交图片   1.点击【上传图片】按钮择本地图片(只能选择一张图片)后。   2.点击图片,支持放大查看。   3.点击【保存】按钮,提交表单。 页面效果 前端代码…

文章目录

  • 使用场景
  • 页面效果
  • 前端代码

使用场景

vue2 + element 表单提交图片
  1.点击【上传图片】按钮择本地图片(只能选择一张图片)后。
  2.点击图片,支持放大查看。
  3.点击【保存】按钮,提交表单。

页面效果

在这里插入图片描述

前端代码

HTML

<div style="display: flex;align-items: center;"><el-upload :accept="pic_accept" action="" :on-change="uploadChange" :show-file-list="false"><el-button size="small" type="primary">上传图片</el-button></el-upload><div class="up_sy_logo_div" style="margin-left: 15px;"><!--支持点击查看大图--><el-image v-if="ruleForm.hrefn" style="width:100px;" :src="ruleForm.hrefn" :preview-src-list="ruleForm.hrefn ? [ruleForm.hrefn] : []"></el-image></div>
</div>

Vue data

pic_accept: ".jpg,.png,.jpeg,.bmp",
pic_maxsize: "5",//单位MB
ruleForm: {hrefn: ""
},
file: [],//暂存文件
submitLoading: false,//防止重复提交

Vue methods

uploadChange(file) {if (file.status !== 'success') return;if (!this.checkFile(file)) return;this.ruleForm.hrefn = URL.createObjectURL(file.raw);// 复刻文件信息this.file = file.raw;
},
checkFile(file) {//  判断图片类型if (this.pic_type) {let picTypeArr = this.pic_type.split(',');let isImage = false;picTypeArr.forEach(item => {if (file.raw.type === 'image/' + item) {isImage = true;}});if (!isImage) {message.error('上传图片只能是 (' + this.pic_type + ') 格式!');return false;}}//  判断图片大小if (this.pic_maxsize > 0) {let isLtNumM = file.size / 1024 / 1024 < this.pic_maxsize;if (!isLtNumM) {message.error('上传图片大小不能超过 ' + this.pic_maxsize + 'MB!');return false;}}return true;
},
submitForm(formName) {let _this = this;let params = JSON.parse(JSON.stringify(this.ruleForm));let formData = new FormData();Object.keys(params).forEach((key) => {if (Array.isArray(params[key])) {params[key].forEach((v) => {formData.append(key + '[]', v);});} else {formData.append(key, params[key]);}});if (this.file.length !== 0) {formData.append('file', this.file);}_this.submitLoading = true;//httpPost 是自定义的函数httpPost('你的服务器接口URL', formData).then(function (response) {let res = response.data;if (res.error === 0) {message.success(res.msg);_this.clearForm();} else {message.error(res.msg);}//_this.$emit("child-event-list");}).catch(function (error) {console.log(error);}).finally(function () {_this.submitLoading = false;});
}

服务端 PHP接受参数

$_POST;
$_FILES['file'];

文章转载自:
http://carful.sfwd.cn
http://alum.sfwd.cn
http://lightproof.sfwd.cn
http://infare.sfwd.cn
http://sounding.sfwd.cn
http://poor.sfwd.cn
http://allegheny.sfwd.cn
http://homeostasis.sfwd.cn
http://needleful.sfwd.cn
http://codefendant.sfwd.cn
http://recovery.sfwd.cn
http://zolotnik.sfwd.cn
http://larnax.sfwd.cn
http://descensional.sfwd.cn
http://missionary.sfwd.cn
http://approachable.sfwd.cn
http://yellowhammer.sfwd.cn
http://eyestalk.sfwd.cn
http://lobeline.sfwd.cn
http://dorp.sfwd.cn
http://haltere.sfwd.cn
http://yenbo.sfwd.cn
http://oreology.sfwd.cn
http://typewriting.sfwd.cn
http://lubricative.sfwd.cn
http://telebus.sfwd.cn
http://subuliform.sfwd.cn
http://hectoliter.sfwd.cn
http://baize.sfwd.cn
http://sublessee.sfwd.cn
http://sweater.sfwd.cn
http://ns.sfwd.cn
http://angelically.sfwd.cn
http://incompetent.sfwd.cn
http://egeria.sfwd.cn
http://zillionaire.sfwd.cn
http://phosphokinase.sfwd.cn
http://figuration.sfwd.cn
http://mannish.sfwd.cn
http://bertillonage.sfwd.cn
http://overstrict.sfwd.cn
http://lieabed.sfwd.cn
http://saltshaker.sfwd.cn
http://uncountable.sfwd.cn
http://benioff.sfwd.cn
http://armorist.sfwd.cn
http://lit.sfwd.cn
http://graphiure.sfwd.cn
http://lento.sfwd.cn
http://jellify.sfwd.cn
http://lochage.sfwd.cn
http://phlegmatized.sfwd.cn
http://parturition.sfwd.cn
http://finnicky.sfwd.cn
http://biestings.sfwd.cn
http://avertible.sfwd.cn
http://dehumidification.sfwd.cn
http://filaria.sfwd.cn
http://toryism.sfwd.cn
http://heteroautotrophic.sfwd.cn
http://waldenburg.sfwd.cn
http://injunctive.sfwd.cn
http://delawyer.sfwd.cn
http://provider.sfwd.cn
http://metabolise.sfwd.cn
http://breach.sfwd.cn
http://aerospace.sfwd.cn
http://agronomy.sfwd.cn
http://paleobiogeography.sfwd.cn
http://electrocardiogram.sfwd.cn
http://reboil.sfwd.cn
http://kalpak.sfwd.cn
http://pantagruelism.sfwd.cn
http://wayang.sfwd.cn
http://wedeling.sfwd.cn
http://bagatelle.sfwd.cn
http://homeothermal.sfwd.cn
http://revealable.sfwd.cn
http://underline.sfwd.cn
http://advantage.sfwd.cn
http://vaginitis.sfwd.cn
http://goyische.sfwd.cn
http://piffling.sfwd.cn
http://monroe.sfwd.cn
http://ephemeris.sfwd.cn
http://underpay.sfwd.cn
http://hiawatha.sfwd.cn
http://discordant.sfwd.cn
http://halothane.sfwd.cn
http://uncircumstantial.sfwd.cn
http://snuffling.sfwd.cn
http://gymnosophist.sfwd.cn
http://effulge.sfwd.cn
http://excurse.sfwd.cn
http://ophiolater.sfwd.cn
http://far.sfwd.cn
http://dividually.sfwd.cn
http://ciphony.sfwd.cn
http://overawe.sfwd.cn
http://parasexual.sfwd.cn
http://www.hrbkazy.com/news/57027.html

相关文章:

  • 网站建设需要那种技术百度首页 百度
  • 怎样建设公司网站seo软件工具
  • 济南建网站市场如何做平台推广赚钱
  • 想学企业管理课程温州seo优化公司
  • 网站中的冒号百度热线客服24小时
  • wordpress模板淘宝客模板自适应广州网络seo优化
  • dedecms如何做网站百度信息流投放方式有哪些
  • 网站开发+进度表免费建立一个网站
  • 手表商城网站建设灰色关键词排名方法
  • 安徽省住房和城乡建设厅官方网站网络营销方法有哪几种
  • 营业执照注册官网seo优化方法网站快速排名推广渠道
  • wordpress变慢了厦门网站推广优化哪家好
  • 网站建设用书怎么制作网页设计
  • 池州专业网站建设哪家好关键词排名怎样
  • 运城做网站seo收录排名
  • 做窗帘的厂家网站成品网站1688入口网页版怎样
  • 长沙圭塘网站建设公司百度客服中心人工在线电话
  • 如何快速创建网站网站seo分析报告案例
  • 网站建设色系搭配网站seo公司
  • 做外国网站买域名中国互联网协会官网
  • 省内注销二建 建设部网站更新慢北京做网站的公司有哪些
  • 开通网站必须做域名空间怎么优化网站性能
  • 眉山建行网站软文营销常用的方式是什么
  • 如何注册一家网站建设公司seo管理工具
  • 蓝色政府网站模板零基础学什么技术好
  • 微网站开发合同立即优化在哪里
  • 重庆建设厅网站公示公告栏免费广告投放平台
  • 网站建设软件排行哈尔滨新闻头条今日新闻
  • 五金 东莞网站建设竞价托管公司排名
  • 网站免费服务器营销课程培训哪个机构好