diff --git a/src/vbenComponents/button/index.ts b/src/vbenComponents/button/index.ts index 900e7489..ea300627 100644 --- a/src/vbenComponents/button/index.ts +++ b/src/vbenComponents/button/index.ts @@ -1,4 +1,6 @@ import { withInstall } from '/@/utils'; import Button from './src/Button.vue'; +import ButtonGroup from './src/ButtonGroup.vue'; export const VbenButton = withInstall(Button); +export const VbenButtonGroup = withInstall(ButtonGroup); diff --git a/src/vbenComponents/button/src/Button.vue b/src/vbenComponents/button/src/Button.vue index d0bf8008..ee8ace24 100644 --- a/src/vbenComponents/button/src/Button.vue +++ b/src/vbenComponents/button/src/Button.vue @@ -1,12 +1,12 @@ diff --git a/src/vbenComponents/button/src/ButtonGroup.vue b/src/vbenComponents/button/src/ButtonGroup.vue new file mode 100644 index 00000000..f08a31c0 --- /dev/null +++ b/src/vbenComponents/button/src/ButtonGroup.vue @@ -0,0 +1,12 @@ + + + + diff --git a/src/vbenComponents/checkbox/index.ts b/src/vbenComponents/checkbox/index.ts new file mode 100644 index 00000000..8a403b15 --- /dev/null +++ b/src/vbenComponents/checkbox/index.ts @@ -0,0 +1,6 @@ +import { withInstall } from '/@/utils'; +import Checkbox from './src/Checkbox.vue'; +import CheckboxGroup from './src/CheckboxGroup.vue'; + +export const VbenCheckbox = withInstall(Checkbox); +export const VbenCheckboxGroup = withInstall(CheckboxGroup); diff --git a/src/vbenComponents/checkbox/src/Checkbox.vue b/src/vbenComponents/checkbox/src/Checkbox.vue new file mode 100644 index 00000000..e9513382 --- /dev/null +++ b/src/vbenComponents/checkbox/src/Checkbox.vue @@ -0,0 +1,12 @@ + + + + diff --git a/src/vbenComponents/checkbox/src/CheckboxGroup.vue b/src/vbenComponents/checkbox/src/CheckboxGroup.vue new file mode 100644 index 00000000..1929f127 --- /dev/null +++ b/src/vbenComponents/checkbox/src/CheckboxGroup.vue @@ -0,0 +1,77 @@ + + + + diff --git a/src/vbenComponents/ellipsis/index.ts b/src/vbenComponents/ellipsis/index.ts new file mode 100644 index 00000000..5ecefbdf --- /dev/null +++ b/src/vbenComponents/ellipsis/index.ts @@ -0,0 +1,4 @@ +import { withInstall } from '/@/utils'; +import Ellipsis from './src/Ellipsis.vue'; + +export const VbenEllipsis = withInstall(Ellipsis); diff --git a/src/vbenComponents/ellipsis/src/Ellipsis.vue b/src/vbenComponents/ellipsis/src/Ellipsis.vue new file mode 100644 index 00000000..858ebde0 --- /dev/null +++ b/src/vbenComponents/ellipsis/src/Ellipsis.vue @@ -0,0 +1,12 @@ + + + + diff --git a/src/vbenComponents/empty/index.ts b/src/vbenComponents/empty/index.ts new file mode 100644 index 00000000..59714657 --- /dev/null +++ b/src/vbenComponents/empty/index.ts @@ -0,0 +1,4 @@ +import { withInstall } from '/@/utils'; +import Empty from './src/Empty.vue'; + +export const VbenEmpty = withInstall(Empty); diff --git a/src/vbenComponents/empty/src/Empty.vue b/src/vbenComponents/empty/src/Empty.vue new file mode 100644 index 00000000..969f3c3b --- /dev/null +++ b/src/vbenComponents/empty/src/Empty.vue @@ -0,0 +1,12 @@ + + + + diff --git a/src/vbenComponents/grid/index.ts b/src/vbenComponents/grid/index.ts new file mode 100644 index 00000000..f5d9c5ba --- /dev/null +++ b/src/vbenComponents/grid/index.ts @@ -0,0 +1,6 @@ +import { withInstall } from '/@/utils'; +import Grid from './src/Grid.vue'; +import GridItem from './src/GridItem.vue'; +GridItem.__GRID_ITEM__ = true; +export const VbenGrid = withInstall(Grid); +export const VbenGridItem = withInstall(GridItem); diff --git a/src/vbenComponents/grid/src/Grid.vue b/src/vbenComponents/grid/src/Grid.vue new file mode 100644 index 00000000..1297310a --- /dev/null +++ b/src/vbenComponents/grid/src/Grid.vue @@ -0,0 +1,12 @@ + + + + diff --git a/src/vbenComponents/grid/src/GridItem.vue b/src/vbenComponents/grid/src/GridItem.vue new file mode 100644 index 00000000..a0445005 --- /dev/null +++ b/src/vbenComponents/grid/src/GridItem.vue @@ -0,0 +1,12 @@ + + + + diff --git a/src/vbenComponents/image/index.ts b/src/vbenComponents/image/index.ts new file mode 100644 index 00000000..34c5bf7f --- /dev/null +++ b/src/vbenComponents/image/index.ts @@ -0,0 +1,4 @@ +import { withInstall } from '/@/utils'; +import Image from './src/Image.vue'; + +export const VbenImage = withInstall(Image); diff --git a/src/vbenComponents/image/src/Image.vue b/src/vbenComponents/image/src/Image.vue new file mode 100644 index 00000000..9b368b1b --- /dev/null +++ b/src/vbenComponents/image/src/Image.vue @@ -0,0 +1,12 @@ + + + + diff --git a/src/vbenComponents/index.ts b/src/vbenComponents/index.ts index 9d3d1c67..2ae6fac7 100644 --- a/src/vbenComponents/index.ts +++ b/src/vbenComponents/index.ts @@ -2,7 +2,10 @@ import type { Component, App } from 'vue'; //组件map export const maps = new Map(); - +export let useMsg = () => {}; +export const setMessage = (func: Fn = () => {}) => { + useMsg = func; +}; // 引入组件 import { VbenPopover } from './popover'; import { VbenDivider } from './divider'; @@ -10,7 +13,7 @@ import { VbenTag } from './tag'; import { VbenTable } from './table'; import { VbenCard } from './card'; import { VbenSpace } from './space'; -import { VbenButton } from './button'; +import { VbenButton, VbenButtonGroup } from './button'; import { VbenAvatar } from './avatar'; import { VbenStatistic } from './statistic'; import { VbenSelect } from './select'; @@ -18,6 +21,16 @@ import { VbenInput } from './input'; import { VbenThing } from './thing'; import { VbenPopconfirm } from './popconfirm'; import { VbenIcon } from './icon'; +import { VbenCheckbox, VbenCheckboxGroup } from './checkbox'; +import { VbenModal } from './modal'; +import { VbenEmpty } from './empty'; +import { VbenUpload } from './upload'; +import { VbenTabs, VbenTabPane } from './tabs'; +import { VbenGrid, VbenGridItem } from './grid'; +import { VbenEllipsis } from './ellipsis'; +import { VbenImage } from './image'; +import { VbenMessageProvider } from './message'; +import { VbenPagination } from './pagination'; // 初始化组件 // global 是否全局注册 @@ -25,6 +38,7 @@ export function initVbenComponent(app: App, comp: Object, global: boolean = true Object.keys(comp).forEach((k) => { maps.set(k, comp[k]); }); + if (!global) return; app .use(VbenCard) @@ -34,11 +48,25 @@ export function initVbenComponent(app: App, comp: Object, global: boolean = true .use(VbenSpace) .use(VbenPopover) .use(VbenButton) + .use(VbenButtonGroup) .use(VbenAvatar) .use(VbenStatistic) .use(VbenSelect) .use(VbenInput) .use(VbenThing) .use(VbenPopconfirm) - .use(VbenIcon); + .use(VbenIcon) + .use(VbenCheckbox) + .use(VbenCheckboxGroup) + .use(VbenModal) + .use(VbenEmpty) + .use(VbenUpload) + .use(VbenTabs) + .use(VbenTabPane) + .use(VbenGrid) + .use(VbenGridItem) + .use(VbenEllipsis) + .use(VbenImage) + .use(VbenMessageProvider) + .use(VbenPagination); } diff --git a/src/vbenComponents/message/index.ts b/src/vbenComponents/message/index.ts new file mode 100644 index 00000000..574d0bb6 --- /dev/null +++ b/src/vbenComponents/message/index.ts @@ -0,0 +1,4 @@ +import { withInstall } from '/@/utils'; +import MessageProvider from './src/MessageProvider.vue'; + +export const VbenMessageProvider = withInstall(MessageProvider); diff --git a/src/vbenComponents/message/src/MessageProvider.vue b/src/vbenComponents/message/src/MessageProvider.vue new file mode 100644 index 00000000..52c87181 --- /dev/null +++ b/src/vbenComponents/message/src/MessageProvider.vue @@ -0,0 +1,12 @@ + + + + diff --git a/src/vbenComponents/modal/index.ts b/src/vbenComponents/modal/index.ts new file mode 100644 index 00000000..b17c1479 --- /dev/null +++ b/src/vbenComponents/modal/index.ts @@ -0,0 +1,4 @@ +import { withInstall } from '/@/utils'; +import Modal from './src/Modal.vue'; + +export const VbenModal = withInstall(Modal); diff --git a/src/vbenComponents/modal/src/Modal.vue b/src/vbenComponents/modal/src/Modal.vue new file mode 100644 index 00000000..78353cd9 --- /dev/null +++ b/src/vbenComponents/modal/src/Modal.vue @@ -0,0 +1,24 @@ + + + + diff --git a/src/vbenComponents/pagination/index.ts b/src/vbenComponents/pagination/index.ts new file mode 100644 index 00000000..c539d47e --- /dev/null +++ b/src/vbenComponents/pagination/index.ts @@ -0,0 +1,4 @@ +import { withInstall } from '/@/utils'; +import Pagination from './src/Pagination.vue'; + +export const VbenPagination = withInstall(Pagination); diff --git a/src/vbenComponents/pagination/src/Pagination.vue b/src/vbenComponents/pagination/src/Pagination.vue new file mode 100644 index 00000000..958e062b --- /dev/null +++ b/src/vbenComponents/pagination/src/Pagination.vue @@ -0,0 +1,12 @@ + + + + diff --git a/src/vbenComponents/tabs/index.ts b/src/vbenComponents/tabs/index.ts new file mode 100644 index 00000000..af670926 --- /dev/null +++ b/src/vbenComponents/tabs/index.ts @@ -0,0 +1,6 @@ +import { withInstall } from '/@/utils'; +import Tabs from './src/Tabs.vue'; +import TabPane from './src/TabPane.vue'; +TabPane.__TAB_PANE__ = true; +export const VbenTabs = withInstall(Tabs); +export const VbenTabPane = withInstall(TabPane); diff --git a/src/vbenComponents/tabs/src/TabPane.vue b/src/vbenComponents/tabs/src/TabPane.vue new file mode 100644 index 00000000..296ae6c1 --- /dev/null +++ b/src/vbenComponents/tabs/src/TabPane.vue @@ -0,0 +1,12 @@ + + + + diff --git a/src/vbenComponents/tabs/src/Tabs.vue b/src/vbenComponents/tabs/src/Tabs.vue new file mode 100644 index 00000000..a23dddad --- /dev/null +++ b/src/vbenComponents/tabs/src/Tabs.vue @@ -0,0 +1,13 @@ + + + + diff --git a/src/vbenComponents/upload/index.ts b/src/vbenComponents/upload/index.ts new file mode 100644 index 00000000..3a6bba7c --- /dev/null +++ b/src/vbenComponents/upload/index.ts @@ -0,0 +1,4 @@ +import { withInstall } from '/@/utils'; +import Upload from './src/Upload.vue'; + +export const VbenUpload = withInstall(Upload); diff --git a/src/vbenComponents/upload/src/Upload.vue b/src/vbenComponents/upload/src/Upload.vue new file mode 100644 index 00000000..d0c47935 --- /dev/null +++ b/src/vbenComponents/upload/src/Upload.vue @@ -0,0 +1,15 @@ + + + +