From 87e7fb202936233b6530e027b521c08abd8c8043 Mon Sep 17 00:00:00 2001 From: caikan Date: Sat, 25 Sep 2021 17:54:53 +0800 Subject: [PATCH] =?UTF-8?q?feat(dragdrop):=20WIP:=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- devui/dragdrop/index.ts | 22 ++++++++++++++++++++++ devui/dragdrop/src/dragdrop-directive.ts | 10 ++++++++++ devui/dragdrop/src/dragdrop-service.ts | 7 +++++++ devui/dragdrop/src/dragdrop-types.ts | 9 +++++++++ devui/dragdrop/src/dragdrop.scss | 3 +++ devui/dragdrop/src/dragdrop.tsx | 18 ++++++++++++++++++ 6 files changed, 69 insertions(+) create mode 100644 devui/dragdrop/index.ts create mode 100644 devui/dragdrop/src/dragdrop-directive.ts create mode 100644 devui/dragdrop/src/dragdrop-service.ts create mode 100644 devui/dragdrop/src/dragdrop-types.ts create mode 100644 devui/dragdrop/src/dragdrop.scss create mode 100644 devui/dragdrop/src/dragdrop.tsx diff --git a/devui/dragdrop/index.ts b/devui/dragdrop/index.ts new file mode 100644 index 00000000..7de249ac --- /dev/null +++ b/devui/dragdrop/index.ts @@ -0,0 +1,22 @@ +import type { App } from 'vue' +import Dragdrop from './src/dragdrop' +import DragdropDirective from './src/dragdrop-directive' +import DragdropService from './src/dragdrop-service' + +Dragdrop.install = function(app: App): void { + app.component(Dragdrop.name, Dragdrop) +} + +export { Dragdrop, DragdropDirective, DragdropService } + +export default { + title: 'Dragdrop 拖拽', + category: '通用', + status: '你猜猜', // TODO: 组件若开发完成则填入"已完成",并删除该注释 + install(app: App): void { + + app.use(Dragdrop as any) + app.directive('Dragdrop', DragdropDirective) + app.config.globalProperties.$dragdropService = DragdropService + } +} diff --git a/devui/dragdrop/src/dragdrop-directive.ts b/devui/dragdrop/src/dragdrop-directive.ts new file mode 100644 index 00000000..788dde30 --- /dev/null +++ b/devui/dragdrop/src/dragdrop-directive.ts @@ -0,0 +1,10 @@ +// can export function. +export default { + // created() { }, + // beforeMount() { }, + // mounted() { }, + // beforeUpdate() { }, + // updated() { }, + // beforeUnmount() { }, + // unmounted() { } +} diff --git a/devui/dragdrop/src/dragdrop-service.ts b/devui/dragdrop/src/dragdrop-service.ts new file mode 100644 index 00000000..11b63135 --- /dev/null +++ b/devui/dragdrop/src/dragdrop-service.ts @@ -0,0 +1,7 @@ +// import { DragdropProps } from './dragdrop-types' + +const DragdropService = { + // open(props: DragdropProps) { } +} + +export default DragdropService diff --git a/devui/dragdrop/src/dragdrop-types.ts b/devui/dragdrop/src/dragdrop-types.ts new file mode 100644 index 00000000..0dd0bb1d --- /dev/null +++ b/devui/dragdrop/src/dragdrop-types.ts @@ -0,0 +1,9 @@ +import type { PropType, ExtractPropTypes } from 'vue' + +export const dragdropProps = { + /* test: { + type: Object as PropType<{ xxx: xxx }> + } */ +} as const + +export type DragdropProps = ExtractPropTypes diff --git a/devui/dragdrop/src/dragdrop.scss b/devui/dragdrop/src/dragdrop.scss new file mode 100644 index 00000000..cabffef6 --- /dev/null +++ b/devui/dragdrop/src/dragdrop.scss @@ -0,0 +1,3 @@ +.d-dragdrop { + // +} diff --git a/devui/dragdrop/src/dragdrop.tsx b/devui/dragdrop/src/dragdrop.tsx new file mode 100644 index 00000000..9f0b8c3c --- /dev/null +++ b/devui/dragdrop/src/dragdrop.tsx @@ -0,0 +1,18 @@ +import './dragdrop.scss' + +import { defineComponent } from 'vue' +import { dragdropProps, DragdropProps } from './dragdrop-types' + +export default defineComponent({ + name: 'DDragdrop', + props: dragdropProps, + emits: [], + setup(props: DragdropProps, ctx) { + return {} + }, + render() { + const {} = this + + return
+ } +}) -- Gitee