feat: vue3

This commit is contained in:
mathuo 2024-05-01 20:22:57 +01:00
parent d0eda81a9e
commit 5d6055c4d2
No known key found for this signature in database
GPG Key ID: C6EEDEFD6CA07281
4 changed files with 6 additions and 32 deletions

View File

@ -1,6 +0,0 @@
const gulp = require('gulp');
const buildfile = require('../../scripts/build');
buildfile.init();
gulp.task('run', gulp.series(['sass']));

View File

@ -2,13 +2,6 @@
import {
DockviewApi,
DockviewComponent,
type IContentRenderer,
type ITabRenderer,
type IWatermarkRenderer,
type IDockviewPanelProps,
type IDockviewPanelHeaderProps,
type IGroupPanelBaseProps,
type IWatermarkPanelProps,
type DockviewOptions,
PROPERTY_KEYS,
type DockviewFrameworkOptions,
@ -22,7 +15,6 @@ import {
watch,
onBeforeUnmount,
markRaw,
toRaw,
getCurrentInstance,
} from 'vue';
import {
@ -41,18 +33,6 @@ interface VueProps {
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 = {
ready: [event: DockviewReadyEvent];
};
@ -73,10 +53,6 @@ function extractCoreOptions(props: IDockviewVueProps): DockviewOptions {
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 el = ref<HTMLElement | null>(null);

View File

@ -15,7 +15,6 @@ class Panel implements IContentRenderer {
constructor() {
this._element = document.createElement('div');
this._element.style.color = 'white';
}
@ -28,7 +27,12 @@ document.getElementById('app').className = 'dockview-theme-abyss';
const dockview = new DockviewComponent({
parentElement: document.getElementById('app'),
components: { default: Panel },
createComponent: (options) => {
switch (options.name) {
case 'default':
return new Panel();
}
},
});
const api = new DockviewApi(dockview);