重构:把 enquireScreen 功能从 device.js 迁移至 util.js;master
							parent
							
								
									d4261bc401
								
							
						
					
					
						commit
						365dde7e66
					
				
				 3 changed files with 18 additions and 20 deletions
			
			
		@ -1,15 +0,0 @@ | 
				
			|||||||
import enquireJs from 'enquire.js' | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
const enquireScreen = function (call) { | 
					 | 
				
			||||||
  const hanlder = { | 
					 | 
				
			||||||
    match: function () { | 
					 | 
				
			||||||
      call && call(true) | 
					 | 
				
			||||||
    }, | 
					 | 
				
			||||||
    unmatch: function () { | 
					 | 
				
			||||||
      call && call(false) | 
					 | 
				
			||||||
    } | 
					 | 
				
			||||||
  } | 
					 | 
				
			||||||
  enquireJs.register('only screen and (max-width: 767.99px)', hanlder) | 
					 | 
				
			||||||
} | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
export default enquireScreen | 
					 | 
				
			||||||
					Loading…
					
					
				
		Reference in new issue