Commit c953c652 authored by JingChao's avatar JingChao

stab

parent d66af184
......@@ -14,6 +14,10 @@ export default {
mixins: [base],
component: { stabItem },
props: {
value: {
type: Number,
default: 0,
},
position: {
type: String,
default: 'top',
......@@ -73,13 +77,23 @@ export default {
}
},
},
watch: {
value (value) {
if (value > this.count - 1) {
throw 'tab index out of bound exception'
} else {
this.defaultActive === value
this.setTabActive(value)
}
},
},
mounted () {
let vm = this
setTimeout(() => {
this.items[vm.current].$el.classList.add('activated')
}, 100)
this.$emit('input', vm.current)
this.scrollToActiveTab(vm.current, this.items[vm.current].$el.clientWidth)
if (vm.value > vm.count - 1) {
throw 'tab index out of bound exception'
} else {
vm.setTabActive(vm.value)
}
},
methods: {
setTabActive (index) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment