mirror of
https://gitee.com/dapppp/ruoyi-plus-vben5.git
synced 2026-03-23 18:04:32 +08:00
refactor: 重构数据权限 - 部门分配组件
This commit is contained in:
27
apps/web-antd/src/components/global/slot.ts
Normal file
27
apps/web-antd/src/components/global/slot.ts
Normal file
@@ -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));
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user