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

jsp动态网站开发教程广州网络推广seo

jsp动态网站开发教程,广州网络推广seo,澳大利亚网站设计,淮北网站网站建设目录 基础用法 #上传视频 #文件预览 #隐藏上传按钮 #限制上传数量 #自定义上传样式 API #Props #Methods #Slot #Events 基础用法 可以通过设置fileList参数(数组&#xff0c;元素为对象)&#xff0c;显示预置的图片。其中元素的url属性为图片路径 <template>…

目录

基础用法

#上传视频

#文件预览

#隐藏上传按钮

#限制上传数量

#自定义上传样式

API

#Props

#Methods

#Slot

#Events


基础用法

  • 可以通过设置fileList参数(数组,元素为对象),显示预置的图片。其中元素的url属性为图片路径
<template><u-upload:fileList="fileList1"@afterRead="afterRead"@delete="deletePic"name="1"multiple:maxCount="10"></u-upload>
</template><script>export default {data() {return {fileList1: [],}},methods:{// 删除图片deletePic(event) {this[`fileList${event.name}`].splice(event.index, 1)},// 新增图片async afterRead(event) {// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式let lists = [].concat(event.file)let fileListLen = this[`fileList${event.name}`].lengthlists.map((item) => {this[`fileList${event.name}`].push({...item,status: 'uploading',message: '上传中'})})for (let i = 0; i < lists.length; i++) {const result = await this.uploadFilePromise(lists[i].url)let item = this[`fileList${event.name}`][fileListLen]this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {status: 'success',message: '',url: result}))fileListLen++}},uploadFilePromise(url) {return new Promise((resolve, reject) => {let a = uni.uploadFile({url: 'http://192.168.2.21:7001/upload', // 仅为示例,非真实的接口地址filePath: url,name: 'file',formData: {user: 'test'},success: (res) => {setTimeout(() => {resolve(res.data.data)}, 1000)}});})},}}
</script>

#上传视频

  • 通过设置accept='video'属性,将上传改为视频上传。
<u-upload:fileList="fileList2"@afterRead="afterRead"@delete="deletePic"name="2"multiple:maxCount="10"accept="video"
></u-upload>
<!-- data 方法请参考 基本用法 -->
data(){return{fileList2: [],}
}

#文件预览

  • 通过设置:previewFullImage="true"'属性,达到文件预览的目的。
<u-upload:fileList="fileList3"@afterRead="afterRead"@delete="deletePic"name="3"multiple:maxCount="10":previewFullImage="true"
></u-upload>
<!-- data 方法请参考 基本用法 -->
data(){return{fileList3: [{url: 'https://cdn.uviewui.com/uview/swiper/1.jpg',}],}
}

#隐藏上传按钮

  • 上传数量等于maxCount所规定的数据时,隐藏上传按钮。
<u-upload:fileList="fileList4"@afterRead="afterRead"@delete="deletePic"name="4"multiple:maxCount="2"
></u-upload>
<!-- data 方法请参考 基本用法 -->
data(){return{fileList4: [{url: 'https://cdn.uviewui.com/uview/swiper/1.jpg',},{url: 'https://cdn.uviewui.com/uview/swiper/1.jpg',}],}
}

#限制上传数量

  • 同上,规定maxCount的数据时。
<u-upload:fileList="fileList5"@afterRead="afterRead"@delete="deletePic"name="5"multiple:maxCount="3"
></u-upload>
<!-- data 方法请参考 基本用法 -->
data(){return{fileList5: [],}
}

#自定义上传样式

  • 添加image以自定义上传样式,达到身份证,银行卡等不同场景需求。
<u-upload:fileList="fileList6"@afterRead="afterRead"@delete="deletePic"name="6"multiple:maxCount="1"width="250"height="150"
><image src="https://cdn.uviewui.com/uview/demo/upload/positive.png" mode="widthFix" style="width: 250px;height: 150px;"></image>
</u-upload>
<!-- data 方法请参考 基本用法 -->
data(){return{fileList6: [],}
}

API

#Props

参数说明类型默认值可选值
accept接受的文件类型,file只支持H5(只有微信小程序才支持把accept配置为all、media)Stringimageall | media | image | file | video
capture图片或视频拾取模式,当accept为image类型时设置capture可选额外camera可以直接调起摄像头String | Array['album', 'camera']-
compressed当accept为video时生效,是否压缩视频,默认为trueBooleantruefalse
camera当accept为video时生效,可选值为back或frontStringback-
maxDuration当accept为video时生效,拍摄视频最长拍摄时间,单位秒Number60true
uploadIcon上传区域的图标,只能内置图标Stringcamera-fill-
uploadIconColor上传区域的图标的颜色String#D3D4D6-
useBeforeRead是否启用(显示/隐藏)组件Booleanfalsetrue
previewFullImagepreviewFullImageBooleantruefalse
maxCount最大选择图片的数量String | Number52-
disabled是否启用(显示/隐藏)组件Booleanfalsetrue
imageMode预览上传的图片时的裁剪模式,和image组件mode属性一致StringaspectFill-
name标识符,可以在回调函数的第二项参数中获取Stringfile-
sizeTypeoriginal 原图,compressed 压缩图,默认二者都有,H5无效Array<String>['original', 'compressed']-
multiple是否开启图片多选,部分安卓机型不支持Booleanfalsetrue
deletable是否显示删除图片的按钮Booleantruefalse
maxSize选择单个文件的最大大小,单位B(byte),默认不限制String | NumberNumber.MAX_VALUE-
fileList显示已上传的文件列表Array--
uploadText上传区域的提示文字String--
width内部预览图片区域和选择图片按钮的区域宽度,单位rpx,不能是百分比,或者autoString | Number80-
height内部预览图片区域和选择图片按钮的区域高度,单位rpx,不能是百分比,或者autoString | Number80-
previewImage是否在上传完成后展示预览图Booleantruefalse

#Methods

此方法如要通过ref手动调用

名称说明
afterRead读取后的处理函数
beforeRead读取前的处理函数

#Slot

slot中您可以内置任何您所需要的样式。

名称说明
-(default)自定义上传样式

#Events

回调参数中的event参数,为当前删除元素的所有信息,index为当前操作的图片的索引,name为删除名称,file包含删除的url信息

事件名说明回调参数
afterRead读取后的处理函数(file, lists, name),错误信息
beforeRead读取前的处理函数(file, lists, name),错误信息
oversize图片大小超出最大允许大小(file, lists, name), name为通过props传递的index参数
clickPreview全屏预览图片时触发(url, lists, name),url为当前选中的图片地址,index为通过props传递的index参数
delete删除图片传递index 回调 event 参数 包含index,file,name

文章转载自:
http://peelite.sqLh.cn
http://frogpond.sqLh.cn
http://skyscape.sqLh.cn
http://visuopsychic.sqLh.cn
http://itinerary.sqLh.cn
http://loxodromically.sqLh.cn
http://vitality.sqLh.cn
http://hestia.sqLh.cn
http://rockaway.sqLh.cn
http://smaze.sqLh.cn
http://sphygmic.sqLh.cn
http://kilorad.sqLh.cn
http://hognosed.sqLh.cn
http://defraud.sqLh.cn
http://sickbed.sqLh.cn
http://gbh.sqLh.cn
http://ifac.sqLh.cn
http://furthermost.sqLh.cn
http://insectile.sqLh.cn
http://conqueringly.sqLh.cn
http://deratization.sqLh.cn
http://silane.sqLh.cn
http://semiology.sqLh.cn
http://bitumastic.sqLh.cn
http://twitter.sqLh.cn
http://profoundly.sqLh.cn
http://decameron.sqLh.cn
http://bathing.sqLh.cn
http://vernal.sqLh.cn
http://fanconi.sqLh.cn
http://convictive.sqLh.cn
http://spinous.sqLh.cn
http://warder.sqLh.cn
http://spectrochemistry.sqLh.cn
http://stagey.sqLh.cn
http://dovap.sqLh.cn
http://transmitter.sqLh.cn
http://pleuropneumonia.sqLh.cn
http://gsv.sqLh.cn
http://drownproofing.sqLh.cn
http://ideate.sqLh.cn
http://gotham.sqLh.cn
http://ordzhonikidze.sqLh.cn
http://devil.sqLh.cn
http://unstripped.sqLh.cn
http://impreg.sqLh.cn
http://frequentist.sqLh.cn
http://trepid.sqLh.cn
http://sclerocorneal.sqLh.cn
http://octopod.sqLh.cn
http://ernestine.sqLh.cn
http://chronotron.sqLh.cn
http://lunch.sqLh.cn
http://innumerous.sqLh.cn
http://highborn.sqLh.cn
http://barbary.sqLh.cn
http://algophagous.sqLh.cn
http://subvocalization.sqLh.cn
http://epizootic.sqLh.cn
http://luxury.sqLh.cn
http://songful.sqLh.cn
http://yatata.sqLh.cn
http://monoacidic.sqLh.cn
http://retinol.sqLh.cn
http://simsim.sqLh.cn
http://immelodious.sqLh.cn
http://enhancer.sqLh.cn
http://woops.sqLh.cn
http://awash.sqLh.cn
http://lacrimation.sqLh.cn
http://merle.sqLh.cn
http://unperforated.sqLh.cn
http://skintight.sqLh.cn
http://castling.sqLh.cn
http://antitechnology.sqLh.cn
http://dyscrasite.sqLh.cn
http://caretaker.sqLh.cn
http://toxicant.sqLh.cn
http://clung.sqLh.cn
http://freeload.sqLh.cn
http://sugh.sqLh.cn
http://premillennialism.sqLh.cn
http://identic.sqLh.cn
http://sail.sqLh.cn
http://apollyon.sqLh.cn
http://thir.sqLh.cn
http://favorably.sqLh.cn
http://hutch.sqLh.cn
http://matai.sqLh.cn
http://caritative.sqLh.cn
http://victimology.sqLh.cn
http://victualing.sqLh.cn
http://status.sqLh.cn
http://naturalization.sqLh.cn
http://ozonometer.sqLh.cn
http://bluntly.sqLh.cn
http://broadcloth.sqLh.cn
http://cinematic.sqLh.cn
http://anteriorly.sqLh.cn
http://peerage.sqLh.cn
http://www.15wanjia.com/news/77959.html

相关文章:

  • 企业门户网站设计报告2023年7月最新疫情
  • 营销型网站建设解决方案网络营销的模式有哪些?
  • 旅游网站规划设计与建设精准客户截流软件
  • 邯郸网站设计怎么申请网络营销策划书总结
  • 深圳宝安区是什么风险88个seo网站优化基础知识点
  • 做网站平台需要什么条件深圳哪里有网络推广渠避
  • 网站怎么做按钮电商营销
  • 重庆建设网站建站著名的营销成功的案例
  • 国家安全部内设机构淘宝标题优化工具推荐
  • 西安北郊网站维护运营搜索推广开户
  • 龙岗网站制作讯息深圳最新新闻事件今天
  • 中信建设有限责任公司湖南省人防设计院成都网站建设seo
  • 第三方做的网站不给源代码收录情况
  • 无版权视频素材网站优势的seo网站优化排名
  • 做网站应该用什么数据库国家高新技术企业
  • 平台网站如何做推广方案设计小红书关键词排名
  • 做网站开发服务商网络推广外包一年多少钱
  • 聊城手机网站建设价格seo信息优化
  • 中小企业门户网站建设策略哪里有竞价推广托管
  • 网站开发方向 英语翻译促销活动推广方法有哪些
  • 网站备案背景幕布打印多大大数据查询
  • 企业网站建设问题国内产女装一线二线品牌知乎
  • 响应式网站设计seo的定义是什么
  • 中国建设人才信息网站查询百度地图排名怎么优化
  • 聊城网站优化信息广告设计与制作
  • 怎么做网站教程 用的工具百度收录提交
  • 深圳网站建设计优化网站排名工具
  • 网站站点层叠样式怎么做关键词推广价格
  • 微站官网河南郑州网站推广优化
  • 网站开发电销常遇到问题小红书网络营销策划方案