mirror of
				https://gitee.com/vant-contrib/vant.git
				synced 2025-10-27 01:32:10 +08:00 
			
		
		
		
	feat(ImagePreview): reset scale after swiping (#7974)
* feat(ImagePreview): reset scale after swiping * fix: should not emit scale event * fix(Calendar): watch type and reset
This commit is contained in:
		
							parent
							
								
									c532be87ff
								
							
						
					
					
						commit
						d20224a47c
					
				| @ -151,9 +151,12 @@ export default createComponent({ | ||||
|   }, | ||||
| 
 | ||||
|   watch: { | ||||
|     type: 'reset', | ||||
|     value: 'init', | ||||
| 
 | ||||
|     type() { | ||||
|       this.reset(); | ||||
|     }, | ||||
| 
 | ||||
|     defaultDate(val) { | ||||
|       this.currentDate = val; | ||||
|       this.scrollIntoView(); | ||||
|  | ||||
| @ -92,6 +92,8 @@ export default { | ||||
|   }, | ||||
| 
 | ||||
|   watch: { | ||||
|     active: 'resetScale', | ||||
| 
 | ||||
|     show(val) { | ||||
|       if (!val) { | ||||
|         this.resetScale(); | ||||
| @ -111,11 +113,15 @@ export default { | ||||
|     }, | ||||
| 
 | ||||
|     setScale(scale) { | ||||
|       this.scale = range(scale, +this.minZoom, +this.maxZoom); | ||||
|       this.$emit('scale', { | ||||
|         scale: this.scale, | ||||
|         index: this.active, | ||||
|       }); | ||||
|       scale = range(scale, +this.minZoom, +this.maxZoom); | ||||
| 
 | ||||
|       if (scale !== this.scale) { | ||||
|         this.scale = scale; | ||||
|         this.$emit('scale', { | ||||
|           scale: this.scale, | ||||
|           index: this.active, | ||||
|         }); | ||||
|       } | ||||
|     }, | ||||
| 
 | ||||
|     toggleScale() { | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user