fix noop
							parent
							
								
									4f9ccead27
								
							
						
					
					
						commit
						4fc9d027f5
					
				|  | @ -2,8 +2,10 @@ import warning from 'warning' | |||
| 
 | ||||
| const warned = {} | ||||
| export default (valid, message) => { | ||||
|   if (!valid && !warned[message]) { | ||||
|     warning(false, message) | ||||
|     warned[message] = true | ||||
|   if (process.env.NODE_ENV !== 'production') { | ||||
|     if (!valid && !warned[message]) { | ||||
|       warning(false, message) | ||||
|       warned[message] = true | ||||
|     } | ||||
|   } | ||||
| } | ||||
|  |  | |||
|  | @ -1,4 +1,6 @@ | |||
| import Icon from '../icon' | ||||
| function noop () { | ||||
| } | ||||
| export default { | ||||
|   props: { | ||||
|     prefixCls: { | ||||
|  | @ -11,11 +13,11 @@ export default { | |||
|     }, | ||||
|     disabled: Boolean, | ||||
|     onKeyDown: { | ||||
|       default: () => {}, | ||||
|       default: noop, | ||||
|       type: Function, | ||||
|     }, | ||||
|     onTabClick: { | ||||
|       default: () => {}, | ||||
|       default: noop, | ||||
|       type: Function, | ||||
|     }, | ||||
|     activeKey: String, | ||||
|  | @ -23,11 +25,11 @@ export default { | |||
|     extraContent: [String, Number, Function], | ||||
|     hideAdd: Boolean, | ||||
|     removeTab: { | ||||
|       default: () => {}, | ||||
|       default: noop, | ||||
|       type: Function, | ||||
|     }, | ||||
|     createNewTab: { | ||||
|       default: () => {}, | ||||
|       default: noop, | ||||
|       type: Function, | ||||
|     }, | ||||
|   }, | ||||
|  |  | |||
|  | @ -22,6 +22,8 @@ function activeKeyIsValid (t, key) { | |||
|   }) | ||||
|   return key !== undefined && keys.indexOf(key) >= 0 | ||||
| } | ||||
| function noop () { | ||||
| } | ||||
| export default { | ||||
|   name: 'Tabs', | ||||
|   components: { Icon }, | ||||
|  | @ -50,8 +52,8 @@ export default { | |||
|         return ['line', 'card', 'editable-card'].includes(value) | ||||
|       }, | ||||
|     }, | ||||
|     onChange: { type: Function, default: () => {} }, | ||||
|     onTabClick: { type: Function, default: () => {} }, | ||||
|     onChange: { type: Function, default: noop }, | ||||
|     onTabClick: { type: Function, default: noop }, | ||||
|   }, | ||||
|   data () { | ||||
|     return { | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	 tangjinzhou
						tangjinzhou