import { computed } from 'vue' import { layoutProps } from '../layout-props' import './index.less' export default { props: layoutProps, setup (props, { slots }) { const grid = computed(() => { return props.config._isGrid }) const classifyOptions = computed(() => { return props.config.classifyOptions || [] }) const getClassifyChildren = (options = [], classifyConfig) => { const { key } = classifyConfig return options.filter(v => { return v.config.classify === key }) } const Item = (classifyConfig, index) => { const children = getClassifyChildren(props.config.options , classifyConfig) // 无children是需要隐藏classify if (children.length === 0) return undefined return
{classifyConfig.title &&

{classifyConfig.title}

}
{slots.item?.({ children: children })}
} return () => (
{classifyOptions.value.map(Item)}
) } }