style: format code
							parent
							
								
									5a4d5ff6a7
								
							
						
					
					
						commit
						6420443466
					
				|  | @ -1,15 +1,11 @@ | ||||||
| export function formatDate(value, format) { | export function formatDate(value, format) { | ||||||
|   const isFunction = function(obj) { |  | ||||||
|     return !!(obj && obj.constructor && obj.call && obj.apply); |  | ||||||
|   }; |  | ||||||
|    |  | ||||||
|   if (!value) { |   if (!value) { | ||||||
|     return ''; |     return ''; | ||||||
|   } |   } | ||||||
|   if (Array.isArray(format)) { |   if (Array.isArray(format)) { | ||||||
|     format = format[0]; |     format = format[0]; | ||||||
|   } |   } | ||||||
|   if (isFunction(format)) { |   if (typeof format === 'function') { | ||||||
|     const result = format(value); |     const result = format(value); | ||||||
|     if (typeof result === 'string') { |     if (typeof result === 'string') { | ||||||
|       return result; |       return result; | ||||||
|  |  | ||||||
|  | @ -157,7 +157,7 @@ export default { | ||||||
|       sPagination: this.getDefaultPagination(this.$props), |       sPagination: this.getDefaultPagination(this.$props), | ||||||
|       pivot: undefined, |       pivot: undefined, | ||||||
|       sComponents: createComponents(this.components), |       sComponents: createComponents(this.components), | ||||||
|       filterDataCnt: 0 |       filterDataCnt: 0, | ||||||
|     }; |     }; | ||||||
|   }, |   }, | ||||||
|   watch: { |   watch: { | ||||||
|  |  | ||||||
|  | @ -92,10 +92,6 @@ export function isAllowedDate(value, disabledDate, disabledTime) { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| export function formatDate(value, format) { | export function formatDate(value, format) { | ||||||
|   const isFunction = function(obj) { |  | ||||||
|     return !!(obj && obj.constructor && obj.call && obj.apply); |  | ||||||
|   }; |  | ||||||
|    |  | ||||||
|   if (!value) { |   if (!value) { | ||||||
|     return ''; |     return ''; | ||||||
|   } |   } | ||||||
|  | @ -104,7 +100,7 @@ export function formatDate(value, format) { | ||||||
|     format = format[0]; |     format = format[0]; | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   if (isFunction(format)) { |   if (typeof format === 'function') { | ||||||
|     const result = format(value); |     const result = format(value); | ||||||
|     if (typeof result === 'string') { |     if (typeof result === 'string') { | ||||||
|       return result; |       return result; | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	 tanjinzhou
						tanjinzhou