update: more bundle stuff
This commit is contained in:
+2
-12
@@ -1,5 +1,5 @@
|
|||||||
import RevueFlow from './container/RevueFlow';
|
import RevueFlow from './container/RevueFlow';
|
||||||
import { App, inject, InjectionKey } from 'vue-demi';
|
import { App } from 'vue-demi';
|
||||||
|
|
||||||
export default RevueFlow;
|
export default RevueFlow;
|
||||||
|
|
||||||
@@ -37,21 +37,11 @@ export interface RevueFlowPlugin {
|
|||||||
install(app: App): void;
|
install(app: App): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const RevueFlowPluginSymbol: InjectionKey<RevueFlowPlugin> = Symbol();
|
export function createRevueFlowPlugin(options?: RevueFlowOptions): RevueFlowPlugin {
|
||||||
|
|
||||||
export function RevueFlowPlugin(): RevueFlowPlugin {
|
|
||||||
const RevueFlowPlugin = inject(RevueFlowPluginSymbol);
|
|
||||||
if (!RevueFlowPlugin) throw new Error('No RevueFlowPlugin provided.');
|
|
||||||
|
|
||||||
return RevueFlowPlugin;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function createVueCounterPlugin(options?: RevueFlowOptions): RevueFlowPlugin {
|
|
||||||
return {
|
return {
|
||||||
options,
|
options,
|
||||||
install(app: App) {
|
install(app: App) {
|
||||||
app.component('revue-flow', RevueFlow);
|
app.component('revue-flow', RevueFlow);
|
||||||
app.provide(RevueFlowPluginSymbol, this);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user