mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-03 04:21:34 +08:00
fix(deprecated-service-layout): type error
This commit is contained in:
parent
5c2183c5bb
commit
df207dfd45
@ -58,7 +58,6 @@ export default defineComponent({
|
||||
controlledValueRef,
|
||||
uncontrolledValueRef
|
||||
)
|
||||
const uncontrolledCollapsedRef = ref(false)
|
||||
const menuItemsRef = computed(() => {
|
||||
return createItems(props.items)
|
||||
})
|
||||
@ -71,9 +70,6 @@ export default defineComponent({
|
||||
syncPath(route.path)
|
||||
})
|
||||
}
|
||||
function doUpdateCollapsed (value: boolean): void {
|
||||
uncontrolledCollapsedRef.value = value
|
||||
}
|
||||
function doUpdateValue (value: string): void {
|
||||
const { onInput, onSelect, 'onUpdate:value': onUpdateValue } = props
|
||||
uncontrolledValueRef.value = value
|
||||
@ -107,12 +103,10 @@ export default defineComponent({
|
||||
return {
|
||||
bodyLayoutInstRef,
|
||||
scrollTo,
|
||||
doUpdateCollapsed,
|
||||
handleMenuUpdateValue,
|
||||
menuItems: menuItemsRef,
|
||||
mergedValue: mergedValueRef,
|
||||
uncontrolledValue: uncontrolledValueRef,
|
||||
uncontrolledCollapsed: uncontrolledCollapsedRef
|
||||
uncontrolledValue: uncontrolledValueRef
|
||||
}
|
||||
},
|
||||
render () {
|
||||
@ -120,9 +114,8 @@ export default defineComponent({
|
||||
bordered: true,
|
||||
...this.siderProps,
|
||||
showTrigger: true,
|
||||
collapsed: this.uncontrolledCollapsed,
|
||||
collapseMode: 'width',
|
||||
showContent: !this.uncontrolledCollapsed,
|
||||
showCollapsedContent: true,
|
||||
nativeScrollbar: false,
|
||||
collapsedWidth: 0,
|
||||
width: 288,
|
||||
@ -135,8 +128,7 @@ export default defineComponent({
|
||||
flexShrink: 0
|
||||
}
|
||||
},
|
||||
style: this.siderProps?.style as any,
|
||||
onUpdateCollapsed: this.doUpdateCollapsed
|
||||
style: this.siderProps?.style as any
|
||||
}
|
||||
const contentProps = {
|
||||
...this.contentProps,
|
||||
|
@ -26,7 +26,7 @@ export default defineComponent({
|
||||
setup (props) {
|
||||
const MenuChild = useMenuChild(props)
|
||||
const { NSubmenu, NMenu } = MenuChild
|
||||
const { props: menuProps, mergedClsPrefixRef } = NMenu
|
||||
const { props: menuProps, mergedClsPrefixRef, mergedCollapsedRef } = NMenu
|
||||
const submenuDisabledRef = NSubmenu
|
||||
? NSubmenu.mergedDisabledRef
|
||||
: { value: false }
|
||||
@ -54,7 +54,7 @@ export default defineComponent({
|
||||
dropdownEnabled: useMemo(() => {
|
||||
return (
|
||||
props.root &&
|
||||
menuProps.collapsed &&
|
||||
mergedCollapsedRef.value &&
|
||||
menuProps.mode !== 'horizontal' &&
|
||||
!mergedDisabledRef.value
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user