pull/9/head
tangjinzhou 2017-12-08 09:49:47 +08:00
parent 4f9ccead27
commit 4fc9d027f5
3 changed files with 15 additions and 9 deletions

View File

@ -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
}
}
}

View File

@ -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,
},
},

View File

@ -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 {