Closed zhangkx666 closed 2 years ago
handleCollapse seems not working. Then I checked the source codes, but I can't find any codes for handleCollapse. Is there any problem with my coding?
handleCollapse
<template> <pro-layout ... :collapsed="state.collapsed" :handle-collapse="handleCollapsed" > ... </pro-layout> </template> <script> import { reactive, ref } from 'vue' export default { name: 'MainLayout', setup() { const state = reactive({ collapsed: false, ... }) const handleCollapsed = () => { state.collapsed = !state.collapsed } return { state, handleCollapsed } } } </script>
Then I can only use the collapsedButtonRender slot to handle collapsed
collapsedButtonRender
<template #collapsedButtonRender> <div class="collapsedIcon" @click="handleCollapsed"> <menu-fold-outlined v-if="!state.collapsed" /> <menu-unfold-outlined v-else /> </div> </template>
文档没更新,直接按照 vue 风格监听即可 @collapse="boolean => void"
@collapse="handleCollapsed"
我改这样了,然而新的报错~
升到 3.2.1
ref https://github.com/vueComponent/pro-components/releases/tag/3.2.1
🧐 问题描述 Problem Description
handleCollapse seems not working. Then I checked the source codes, but I can't find any codes for
handleCollapse
. Is there any problem with my coding?💻 示例代码 Sample code
🚑 其他信息 Other information
Then I can only use the
collapsedButtonRender
slot to handle collapsed