mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-21 04:50:14 +08:00
fix(collapse): default-expanded-names
not working
This commit is contained in:
parent
06e052150f
commit
3f0714cebf
@ -1,5 +1,9 @@
|
||||
# CHANGELOG
|
||||
|
||||
## Pending
|
||||
|
||||
- Fix `n-collapse` `default-expanded-names` not working.
|
||||
|
||||
## 2.11.2
|
||||
|
||||
### Fixes
|
||||
|
@ -1,5 +1,11 @@
|
||||
# CHANGELOG
|
||||
|
||||
## Pending
|
||||
|
||||
### Fixes
|
||||
|
||||
- 修复 `n-collapse` `default-expanded-names` 不生效
|
||||
|
||||
## 2.11.2
|
||||
|
||||
### Fixes
|
||||
|
@ -29,9 +29,12 @@ import {
|
||||
|
||||
const collapseProps = {
|
||||
...(useTheme.props as ThemeProps<CollapseTheme>),
|
||||
defaultExpandesNames: [Array, String] as PropType<
|
||||
string | number | Array<string | number> | null
|
||||
>,
|
||||
defaultExpandedNames: {
|
||||
type: [Array, String] as PropType<
|
||||
string | number | Array<string | number> | null
|
||||
>,
|
||||
default: null
|
||||
},
|
||||
expandedNames: [Array, String] as PropType<
|
||||
string | number | Array<string | number> | null
|
||||
>,
|
||||
@ -98,8 +101,9 @@ export default defineComponent({
|
||||
props: collapseProps,
|
||||
setup (props, { slots }) {
|
||||
const { mergedClsPrefixRef } = useConfig(props)
|
||||
const uncontrolledExpandedNamesRef =
|
||||
ref<string | number | Array<string | number> | null>(null)
|
||||
const uncontrolledExpandedNamesRef = ref<
|
||||
string | number | Array<string | number> | null
|
||||
>(props.defaultExpandedNames)
|
||||
const controlledExpandedNamesRef = computed(() => props.expandedNames)
|
||||
const mergedExpandedNamesRef = useMergedState(
|
||||
controlledExpandedNamesRef,
|
||||
|
Loading…
Reference in New Issue
Block a user