|
|
@@ -40,19 +40,43 @@ export default {
|
|
|
},
|
|
|
name: {
|
|
|
type: String,
|
|
|
- default: uni.$u.props.upload.name
|
|
|
+ default: (() => {
|
|
|
+ try {
|
|
|
+ return uni.$u && uni.$u.props && uni.$u.props.upload && uni.$u.props.upload.name || 'file'
|
|
|
+ } catch (e) {
|
|
|
+ return 'file'
|
|
|
+ }
|
|
|
+ })()
|
|
|
},
|
|
|
accept: {
|
|
|
type: String,
|
|
|
- default: uni.$u.props.upload.accept
|
|
|
+ default: (() => {
|
|
|
+ try {
|
|
|
+ return uni.$u && uni.$u.props && uni.$u.props.upload && uni.$u.props.upload.accept || 'image'
|
|
|
+ } catch (e) {
|
|
|
+ return 'image'
|
|
|
+ }
|
|
|
+ })()
|
|
|
},
|
|
|
width: {
|
|
|
type: [String, Number],
|
|
|
- default: uni.$u.props.upload.width
|
|
|
+ default: (() => {
|
|
|
+ try {
|
|
|
+ return uni.$u && uni.$u.props && uni.$u.props.upload && uni.$u.props.upload.width || 150
|
|
|
+ } catch (e) {
|
|
|
+ return 150
|
|
|
+ }
|
|
|
+ })()
|
|
|
},
|
|
|
height: {
|
|
|
type: [String, Number],
|
|
|
- default: uni.$u.props.upload.height
|
|
|
+ default: (() => {
|
|
|
+ try {
|
|
|
+ return uni.$u && uni.$u.props && uni.$u.props.upload && uni.$u.props.upload.height || 150
|
|
|
+ } catch (e) {
|
|
|
+ return 150
|
|
|
+ }
|
|
|
+ })()
|
|
|
},
|
|
|
maxCount: {
|
|
|
type: Number,
|