refactor(core): deprecate useVueFlow options arg (#1465)
refactor(core): deprecate vueflow options
This commit is contained in:
@@ -18,6 +18,7 @@ type Scope = (EffectScope & { vueFlowId: string }) | undefined
|
|||||||
* If no store instance is found in context, a new store instance is created and registered in storage
|
* If no store instance is found in context, a new store instance is created and registered in storage
|
||||||
*
|
*
|
||||||
* @public
|
* @public
|
||||||
|
* @param options - optional options to initialize the store instance
|
||||||
* @returns a vue flow store instance
|
* @returns a vue flow store instance
|
||||||
*/
|
*/
|
||||||
export function useVueFlow(options?: FlowOptions): VueFlowStore {
|
export function useVueFlow(options?: FlowOptions): VueFlowStore {
|
||||||
@@ -125,5 +126,9 @@ export function useVueFlow(options?: FlowOptions): VueFlowStore {
|
|||||||
scope.vueFlowId = vueFlow.id
|
scope.vueFlowId = vueFlow.id
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (options) {
|
||||||
|
warn('options are deprecated and will be removed in the next major version. Use props on the `<VueFlow>` component instead.')
|
||||||
|
}
|
||||||
|
|
||||||
return vueFlow
|
return vueFlow
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -208,6 +208,7 @@ export interface FlowProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Todo: Remove in next major version
|
// Todo: Remove in next major version
|
||||||
|
/** @deprecated use `FlowProps` instead */
|
||||||
export type FlowOptions = FlowProps
|
export type FlowOptions = FlowProps
|
||||||
|
|
||||||
export interface FlowEmits {
|
export interface FlowEmits {
|
||||||
|
|||||||
Reference in New Issue
Block a user