mirror of
https://github.com/vbenjs/gf-vben-admin.git
synced 2025-02-02 19:08:40 +08:00
wip: more VbenComponent
This commit is contained in:
parent
2baec25423
commit
fbe20240e9
4
src/vbenComponents/avatar/index.ts
Normal file
4
src/vbenComponents/avatar/index.ts
Normal file
@ -0,0 +1,4 @@
|
||||
import { withInstall } from '/@/utils';
|
||||
import Avatar from './src/Avatar.vue';
|
||||
|
||||
export const VbenAvatar = withInstall(Avatar);
|
12
src/vbenComponents/avatar/src/Avatar.vue
Normal file
12
src/vbenComponents/avatar/src/Avatar.vue
Normal file
@ -0,0 +1,12 @@
|
||||
<script lang="ts" setup name="VbenAvatar">
|
||||
import { maps } from '/@/vbenComponents';
|
||||
const Avatar = maps.get('Avatar');
|
||||
</script>
|
||||
<template>
|
||||
<Avatar v-bind="$attrs">
|
||||
<template #[item]="data" v-for="item in Object.keys($slots)" :key="item">
|
||||
<slot :name="item" v-bind="data || {}"></slot> </template
|
||||
></Avatar>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
4
src/vbenComponents/icon/index.ts
Normal file
4
src/vbenComponents/icon/index.ts
Normal file
@ -0,0 +1,4 @@
|
||||
import { withInstall } from '/@/utils';
|
||||
import Icon from './src/Icon.vue';
|
||||
|
||||
export const VbenIcon = withInstall(Icon);
|
12
src/vbenComponents/icon/src/Icon.vue
Normal file
12
src/vbenComponents/icon/src/Icon.vue
Normal file
@ -0,0 +1,12 @@
|
||||
<script lang="ts" setup name="VbenIcon">
|
||||
import { maps } from '/@/vbenComponents';
|
||||
const Icon = maps.get('Icon');
|
||||
</script>
|
||||
<template>
|
||||
<Icon v-bind="$attrs">
|
||||
<template #[item]="data" v-for="item in Object.keys($slots)" :key="item">
|
||||
<slot :name="item" v-bind="data || {}"></slot> </template
|
||||
></Icon>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
@ -11,6 +11,13 @@ import { VbenTable } from './table';
|
||||
import { VbenCard } from './card';
|
||||
import { VbenSpace } from './space';
|
||||
import { VbenButton } from './button';
|
||||
import { VbenAvatar } from './avatar';
|
||||
import { VbenStatistic } from './statistic';
|
||||
import { VbenSelect } from './select';
|
||||
import { VbenInput } from './input';
|
||||
import { VbenThing } from './thing';
|
||||
import { VbenPopconfirm } from './popconfirm';
|
||||
import { VbenIcon } from './icon';
|
||||
|
||||
// 初始化组件
|
||||
// global 是否全局注册
|
||||
@ -26,5 +33,12 @@ export function initVbenComponent(app: App, comp: Object, global: boolean = true
|
||||
.use(VbenDivider)
|
||||
.use(VbenSpace)
|
||||
.use(VbenPopover)
|
||||
.use(VbenButton);
|
||||
.use(VbenButton)
|
||||
.use(VbenAvatar)
|
||||
.use(VbenStatistic)
|
||||
.use(VbenSelect)
|
||||
.use(VbenInput)
|
||||
.use(VbenThing)
|
||||
.use(VbenPopconfirm)
|
||||
.use(VbenIcon);
|
||||
}
|
||||
|
4
src/vbenComponents/input/index.ts
Normal file
4
src/vbenComponents/input/index.ts
Normal file
@ -0,0 +1,4 @@
|
||||
import { withInstall } from '/@/utils';
|
||||
import Input from './src/Input.vue';
|
||||
|
||||
export const VbenInput = withInstall(Input);
|
12
src/vbenComponents/input/src/Input.vue
Normal file
12
src/vbenComponents/input/src/Input.vue
Normal file
@ -0,0 +1,12 @@
|
||||
<script lang="ts" setup name="VbenInput">
|
||||
import { maps } from '/@/vbenComponents';
|
||||
const Input = maps.get('Input');
|
||||
</script>
|
||||
<template>
|
||||
<Input v-bind="$attrs">
|
||||
<template #[item]="data" v-for="item in Object.keys($slots)" :key="item">
|
||||
<slot :name="item" v-bind="data || {}"></slot> </template
|
||||
></Input>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
4
src/vbenComponents/popconfirm/index.ts
Normal file
4
src/vbenComponents/popconfirm/index.ts
Normal file
@ -0,0 +1,4 @@
|
||||
import { withInstall } from '/@/utils';
|
||||
import Popconfirm from './src/Popconfirm.vue';
|
||||
|
||||
export const VbenPopconfirm = withInstall(Popconfirm);
|
12
src/vbenComponents/popconfirm/src/Popconfirm.vue
Normal file
12
src/vbenComponents/popconfirm/src/Popconfirm.vue
Normal file
@ -0,0 +1,12 @@
|
||||
<script lang="ts" setup name="VbenPopconfirm">
|
||||
import { maps } from '/@/vbenComponents';
|
||||
const Popconfirm = maps.get('Popconfirm');
|
||||
</script>
|
||||
<template>
|
||||
<Popconfirm v-bind="$attrs">
|
||||
<template #[item]="data" v-for="item in Object.keys($slots)" :key="item">
|
||||
<slot :name="item" v-bind="data || {}"></slot> </template
|
||||
></Popconfirm>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
4
src/vbenComponents/select/index.ts
Normal file
4
src/vbenComponents/select/index.ts
Normal file
@ -0,0 +1,4 @@
|
||||
import { withInstall } from '/@/utils';
|
||||
import Select from './src/Select.vue';
|
||||
|
||||
export const VbenSelect = withInstall(Select);
|
12
src/vbenComponents/select/src/Select.vue
Normal file
12
src/vbenComponents/select/src/Select.vue
Normal file
@ -0,0 +1,12 @@
|
||||
<script lang="ts" setup name="VbenSelect">
|
||||
import { maps } from '/@/vbenComponents';
|
||||
const Select = maps.get('Select');
|
||||
</script>
|
||||
<template>
|
||||
<Select v-bind="$attrs">
|
||||
<template #[item]="data" v-for="item in Object.keys($slots)" :key="item">
|
||||
<slot :name="item" v-bind="data || {}"></slot> </template
|
||||
></Select>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
4
src/vbenComponents/statistic/index.ts
Normal file
4
src/vbenComponents/statistic/index.ts
Normal file
@ -0,0 +1,4 @@
|
||||
import { withInstall } from '/@/utils';
|
||||
import Statistic from './src/Statistic.vue';
|
||||
|
||||
export const VbenStatistic = withInstall(Statistic);
|
12
src/vbenComponents/statistic/src/Statistic.vue
Normal file
12
src/vbenComponents/statistic/src/Statistic.vue
Normal file
@ -0,0 +1,12 @@
|
||||
<script lang="ts" setup name="VbenStatistic">
|
||||
import { maps } from '/@/vbenComponents';
|
||||
const Statistic = maps.get('Statistic');
|
||||
</script>
|
||||
<template>
|
||||
<Statistic v-bind="$attrs">
|
||||
<template #[item]="data" v-for="item in Object.keys($slots)" :key="item">
|
||||
<slot :name="item" v-bind="data || {}"></slot> </template
|
||||
></Statistic>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
@ -1,6 +1,6 @@
|
||||
<script lang="ts" setup name="VbenTable">
|
||||
import type { VbenTableProps } from './type';
|
||||
import { computed, PropType, ref } from 'vue';
|
||||
import { computed, PropType, ref, useSlots } from 'vue';
|
||||
import { isFunction, isBoolean } from '/@/utils/is';
|
||||
|
||||
const props = defineProps({
|
||||
@ -16,7 +16,7 @@
|
||||
delete options?.title;
|
||||
getProxyConfig(options);
|
||||
getPageConfig(options);
|
||||
console.log(options);
|
||||
// console.log(options);
|
||||
return {
|
||||
...options,
|
||||
};
|
||||
@ -59,6 +59,9 @@
|
||||
options.pagerConfig = pagination;
|
||||
}
|
||||
};
|
||||
const slot = useSlots();
|
||||
|
||||
console.log(slot);
|
||||
</script>
|
||||
<template>
|
||||
<div class="m-2 p-2 bg-white">
|
||||
|
4
src/vbenComponents/thing/index.ts
Normal file
4
src/vbenComponents/thing/index.ts
Normal file
@ -0,0 +1,4 @@
|
||||
import { withInstall } from '/@/utils';
|
||||
import Thing from './src/Thing.vue';
|
||||
|
||||
export const VbenThing = withInstall(Thing);
|
12
src/vbenComponents/thing/src/Thing.vue
Normal file
12
src/vbenComponents/thing/src/Thing.vue
Normal file
@ -0,0 +1,12 @@
|
||||
<script lang="ts" setup name="VbenThing">
|
||||
import { maps } from '/@/vbenComponents';
|
||||
const Thing = maps.get('Thing');
|
||||
</script>
|
||||
<template>
|
||||
<Thing v-bind="$attrs">
|
||||
<template #[item]="data" v-for="item in Object.keys($slots)" :key="item">
|
||||
<slot :name="item" v-bind="data || {}"></slot> </template
|
||||
></Thing>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
Loading…
Reference in New Issue
Block a user