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