Skip to content

Commit

Permalink
feat: crud组件选项卡添加插槽,支持自定义title
Browse files Browse the repository at this point in the history
  • Loading branch information
kanyxmo committed Jul 18, 2023
1 parent 6ce042d commit 5c2dc93
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/ma-crud/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
class="ma-tabs mb-5"
>
<template #extra><slot name="tabExtra"></slot></template>
<a-tab-pane :key="item.value" :title="item.label" v-for="item in options.tabs.data"></a-tab-pane>
<a-tab-pane :key="item.value" :title="item.label" v-for="item in options.tabs.data">
<template #title><slot :name="'tabTitle-' + item.label">{{ item.label }}</slot></template>
</a-tab-pane>
</a-tabs>
<ma-search
@search="searchSubmitHandler"
Expand Down Expand Up @@ -337,7 +339,9 @@ const init = async () => {
await loadDict(dicts.value, item)
}
})
await tabsHandler();
setTimeout(async () => {
await tabsHandler()
}, 500)

This comment has been minimized.

Copy link
@wxfjamdc

wxfjamdc Feb 22, 2024

为什么增加 setTimeout ?
这导致了进入页面的时候,如果 tabs 没有配置 defaultKey 的时候,requestData 方法将报错。

}
Expand Down

0 comments on commit 5c2dc93

Please sign in to comment.