diff --git a/apps/web-antd/src/components/global/slot.ts b/apps/web-antd/src/components/global/slot.ts new file mode 100644 index 00000000..0c4eb02c --- /dev/null +++ b/apps/web-antd/src/components/global/slot.ts @@ -0,0 +1,27 @@ +import { defineComponent, h } from 'vue'; + +/** + * 使用默认插槽来自定义组件 + * 给vbenForm的components使用 + */ +export const DefaultSlot = defineComponent({ + name: 'DefaultSlot', + inheritAttrs: false, + props: { + /** + * 绑定到根节点的div上的属性 + */ + rootDivAttrs: { + type: Object, + default: () => ({}), + }, + }, + render() { + /** + * 获取属性 传递给作用域插槽供外部使用 + */ + const attrs = this.$attrs; + + return h('div', { ...this.rootDivAttrs }, this.$slots.default?.(attrs)); + }, +}); diff --git a/apps/web-antd/src/components/tree/src/tree-select-panel.vue b/apps/web-antd/src/components/tree/src/tree-select-panel.vue index e7597f91..046ee63a 100644 --- a/apps/web-antd/src/components/tree/src/tree-select-panel.vue +++ b/apps/web-antd/src/components/tree/src/tree-select-panel.vue @@ -1,215 +1,170 @@