mirror of
https://github.com/mathuo/dockview
synced 2025-08-27 12:36:35 +00:00
feat: vue3
This commit is contained in:
parent
d0eda81a9e
commit
5d6055c4d2
@ -1,6 +0,0 @@
|
|||||||
const gulp = require('gulp');
|
|
||||||
const buildfile = require('../../scripts/build');
|
|
||||||
|
|
||||||
buildfile.init();
|
|
||||||
|
|
||||||
gulp.task('run', gulp.series(['sass']));
|
|
@ -2,13 +2,6 @@
|
|||||||
import {
|
import {
|
||||||
DockviewApi,
|
DockviewApi,
|
||||||
DockviewComponent,
|
DockviewComponent,
|
||||||
type IContentRenderer,
|
|
||||||
type ITabRenderer,
|
|
||||||
type IWatermarkRenderer,
|
|
||||||
type IDockviewPanelProps,
|
|
||||||
type IDockviewPanelHeaderProps,
|
|
||||||
type IGroupPanelBaseProps,
|
|
||||||
type IWatermarkPanelProps,
|
|
||||||
type DockviewOptions,
|
type DockviewOptions,
|
||||||
PROPERTY_KEYS,
|
PROPERTY_KEYS,
|
||||||
type DockviewFrameworkOptions,
|
type DockviewFrameworkOptions,
|
||||||
@ -22,7 +15,6 @@ import {
|
|||||||
watch,
|
watch,
|
||||||
onBeforeUnmount,
|
onBeforeUnmount,
|
||||||
markRaw,
|
markRaw,
|
||||||
toRaw,
|
|
||||||
getCurrentInstance,
|
getCurrentInstance,
|
||||||
} from 'vue';
|
} from 'vue';
|
||||||
import {
|
import {
|
||||||
@ -41,18 +33,6 @@ interface VueProps {
|
|||||||
prefixHeaderActionsComponent?: string;
|
prefixHeaderActionsComponent?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const VUE_PROPERTIES = (() => {
|
|
||||||
const _value: Record<keyof VueProps, undefined> = {
|
|
||||||
watermarkComponent: undefined,
|
|
||||||
defaultTabComponent: undefined,
|
|
||||||
rightHeaderActionsComponent: undefined,
|
|
||||||
leftHeaderActionsComponent: undefined,
|
|
||||||
prefixHeaderActionsComponent: undefined,
|
|
||||||
};
|
|
||||||
|
|
||||||
return Object.keys(_value) as (keyof VueProps)[];
|
|
||||||
})();
|
|
||||||
|
|
||||||
type VueEvents = {
|
type VueEvents = {
|
||||||
ready: [event: DockviewReadyEvent];
|
ready: [event: DockviewReadyEvent];
|
||||||
};
|
};
|
||||||
@ -73,10 +53,6 @@ function extractCoreOptions(props: IDockviewVueProps): DockviewOptions {
|
|||||||
|
|
||||||
const emit = defineEmits<VueEvents>();
|
const emit = defineEmits<VueEvents>();
|
||||||
|
|
||||||
/**
|
|
||||||
* Anything here that is a Vue.js component should not be reactive
|
|
||||||
* i.e. markRaw(toRaw(...))
|
|
||||||
*/
|
|
||||||
const props = defineProps<IDockviewVueProps>();
|
const props = defineProps<IDockviewVueProps>();
|
||||||
|
|
||||||
const el = ref<HTMLElement | null>(null);
|
const el = ref<HTMLElement | null>(null);
|
||||||
|
@ -15,7 +15,6 @@ class Panel implements IContentRenderer {
|
|||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this._element = document.createElement('div');
|
this._element = document.createElement('div');
|
||||||
|
|
||||||
this._element.style.color = 'white';
|
this._element.style.color = 'white';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -28,7 +27,12 @@ document.getElementById('app').className = 'dockview-theme-abyss';
|
|||||||
|
|
||||||
const dockview = new DockviewComponent({
|
const dockview = new DockviewComponent({
|
||||||
parentElement: document.getElementById('app'),
|
parentElement: document.getElementById('app'),
|
||||||
components: { default: Panel },
|
createComponent: (options) => {
|
||||||
|
switch (options.name) {
|
||||||
|
case 'default':
|
||||||
|
return new Panel();
|
||||||
|
}
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const api = new DockviewApi(dockview);
|
const api = new DockviewApi(dockview);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user