Skip to content

Commit

Permalink
Fix issue tabpicker (#253)
Browse files Browse the repository at this point in the history
* fix(tab-picker):clear other children options for issue #252

* fix(tab-picker):revert test demo for issue #252
  • Loading branch information
qimanmanman authored and xxyan0205 committed Dec 16, 2018
1 parent de0d419 commit c4e6754
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion components/tab-picker/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -361,13 +361,22 @@ export default {
} else {
data = []
}
if (!data || data.length === 0) {
this.subTitles.splice(this.currentIndex + 1, this.subTitles.length - 1)
this.renderData.splice(this.currentIndex + 1, this.renderData.length - 1)
this.currentColumnLock = false
return
}
this.subTitles.splice(this.currentIndex + 1, this.subTitles.length - 1, this.placeholder)
this.renderData.splice(this.currentIndex + 1, this.renderData.length - 1, {
index: this.currentIndex,
clickedKey: -1,
data,
asyncFunc,
})
if (this.renderData.length > 1) {
this.$nextTick(() => {
this.$refs.tabs.selectTab(++this.currentIndex)
Expand Down Expand Up @@ -428,13 +437,15 @@ export default {
this.subTitles[this.currentIndex] = value.label
const currentColumn = this.renderData[this.currentIndex]
currentColumn.clickedKey = index
this.$emit('change', {
selectTab: this.currentIndex,
selectIndex: index,
selectItem: value,
})
if (this.dataStruct === 'cascade') {
if (value && value.children && Array.isArray(value.children) && value.children.length > 0) {
if (value && value.children && Array.isArray(value.children)) {
this.$_renderNextTabContent(value.children)()
return
}
Expand Down

0 comments on commit c4e6754

Please sign in to comment.