fix(deprecated-service-layout): type error

This commit is contained in:
07akioni 2021-05-25 17:03:24 +08:00
parent 5c2183c5bb
commit df207dfd45
2 changed files with 5 additions and 13 deletions

View File

@ -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,

View File

@ -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
)