1
This commit is contained in:
23
uview-plus/components/u-upload/mixin.js
Normal file
23
uview-plus/components/u-upload/mixin.js
Normal file
@@ -0,0 +1,23 @@
|
||||
import { error } from '../../libs/function/index'
|
||||
|
||||
export const mixinUpload = {
|
||||
watch: {
|
||||
// 监听accept的变化,判断是否符合个平台要求
|
||||
// 只有微信小程序才支持选择媒体,文件类型,所以这里做一个判断提示
|
||||
accept: {
|
||||
immediate: true,
|
||||
handler(val) {
|
||||
// #ifndef MP-WEIXIN
|
||||
if (val === 'all' || val === 'media') {
|
||||
error('只有微信小程序才支持把accept配置为all、media之一')
|
||||
}
|
||||
// #endif
|
||||
// #ifndef H5 || MP-WEIXIN
|
||||
if (val === 'file') {
|
||||
error('只有微信小程序和H5(HX2.9.9)才支持把accept配置为file')
|
||||
}
|
||||
// #endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
130
uview-plus/components/u-upload/props.js
Normal file
130
uview-plus/components/u-upload/props.js
Normal file
File diff suppressed because it is too large
Load Diff
576
uview-plus/components/u-upload/u-upload.vue
Normal file
576
uview-plus/components/u-upload/u-upload.vue
Normal file
File diff suppressed because it is too large
Load Diff
37
uview-plus/components/u-upload/upload.js
Normal file
37
uview-plus/components/u-upload/upload.js
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* @Author : LQ
|
||||
* @Description :
|
||||
* @version : 1.0
|
||||
* @Date : 2021-08-20 16:44:21
|
||||
* @LastAuthor : LQ
|
||||
* @lastTime : 2021-08-20 17:09:50
|
||||
* @FilePath : /u-view2.0/uview-ui/libs/config/props/upload.js
|
||||
*/
|
||||
export default {
|
||||
// upload组件
|
||||
upload: {
|
||||
accept: 'image',
|
||||
extension: [],
|
||||
capture: ['album', 'camera'],
|
||||
compressed: true,
|
||||
camera: 'back',
|
||||
maxDuration: 60,
|
||||
uploadIcon: 'camera-fill',
|
||||
uploadIconColor: '#D3D4D6',
|
||||
useBeforeRead: false,
|
||||
previewFullImage: true,
|
||||
maxCount: 52,
|
||||
disabled: false,
|
||||
imageMode: 'aspectFill',
|
||||
name: '',
|
||||
sizeType: ['original', 'compressed'],
|
||||
multiple: false,
|
||||
deletable: true,
|
||||
maxSize: Number.MAX_VALUE,
|
||||
fileList: [],
|
||||
uploadText: '',
|
||||
width: 80,
|
||||
height: 80,
|
||||
previewImage: true
|
||||
}
|
||||
}
|
||||
166
uview-plus/components/u-upload/utils.js
Normal file
166
uview-plus/components/u-upload/utils.js
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user