mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-21 04:50:14 +08:00
fix(tab-pane): throws error when using v-if
This commit is contained in:
parent
30d0299e0d
commit
49c3f587c5
@ -23,6 +23,7 @@
|
||||
- Remove `n-calendar`'s useless `console.log`.
|
||||
- Fix loading-bar disappears unexpectl, closes [#343](https://github.com/TuSimple/naive-ui/issues/343).
|
||||
- Fix `n-select` doesn't scroll to selected item when menu is opened, closes [#346](https://github.com/TuSimple/naive-ui/issues/346).
|
||||
- Fix `n-tab-pane` throws error when using v-if.
|
||||
|
||||
## 2.15.1 (2021-06-30)
|
||||
|
||||
|
@ -23,6 +23,7 @@
|
||||
- 移除 `n-calendar` 无用的 console.log
|
||||
- 修复 loading-bar 自动消失,关闭 [#343](https://github.com/TuSimple/naive-ui/issues/343)
|
||||
- 修复 `n-select` 打开菜单时没有自动滚动到选中项,关闭 [#346](https://github.com/TuSimple/naive-ui/issues/346)
|
||||
- 修复 `n-tab-pane` 在使用 v-if 时报错
|
||||
|
||||
## 2.15.1 (2021-06-30)
|
||||
|
||||
|
@ -38,6 +38,7 @@ export const tabPaneProps = {
|
||||
export type TabPaneProps = ExtractPublicPropTypes<typeof tabPaneProps>
|
||||
|
||||
export default defineComponent({
|
||||
__TAB_PANE__: true,
|
||||
name: 'TabPane',
|
||||
alias: ['TabPanel'],
|
||||
props: tabPaneProps,
|
||||
|
@ -378,7 +378,11 @@ export default defineComponent({
|
||||
mergedSize,
|
||||
$slots: { default: defaultSlot, prefix: prefixSlot, suffix: suffixSlot }
|
||||
} = this
|
||||
const children = defaultSlot ? flatten(defaultSlot()) : []
|
||||
const children = defaultSlot
|
||||
? flatten(defaultSlot()).filter((v) => {
|
||||
return (v.type as any).__TAB_PANE__ === true
|
||||
})
|
||||
: []
|
||||
const prefix = prefixSlot ? prefixSlot() : null
|
||||
const suffix = suffixSlot ? suffixSlot() : null
|
||||
const isCard = type === 'card'
|
||||
|
Loading…
Reference in New Issue
Block a user