refactor(flow): remove defaults for props

* defaults are set by store
* use watcher immediate trigger only if prop exists

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
Braks
2021-12-20 19:29:52 +01:00
parent fbe62b9ab9
commit dcbe9865e9
2 changed files with 47 additions and 46 deletions
+15 -14
View File
@@ -6,20 +6,21 @@ import type { FlowProps } from '../../types/flow'
import useWatch from './watch'
const props = withDefaults(defineProps<FlowProps>(), {
snapToGrid: false,
onlyRenderVisibleElements: false,
edgesUpdatable: false,
nodesConnectable: true,
nodesDraggable: true,
elementsSelectable: true,
selectNodesOnDrag: true,
preventScrolling: true,
zoomOnScroll: true,
zoomOnPinch: true,
zoomOnDoubleClick: true,
panOnScroll: false,
paneMoveable: true,
applyDefault: true,
snapToGrid: undefined,
onlyRenderVisibleElements: undefined,
edgesUpdatable: undefined,
nodesConnectable: undefined,
nodesDraggable: undefined,
elementsSelectable: undefined,
selectNodesOnDrag: undefined,
preventScrolling: undefined,
zoomOnScroll: undefined,
zoomOnPinch: undefined,
zoomOnDoubleClick: undefined,
panOnScroll: undefined,
paneMoveable: undefined,
applyDefault: undefined,
fitViewOnInit: undefined,
})
const emit = defineEmits([...Object.keys(createHooks()), 'update:modelValue', 'update:elements', 'update:edges', 'update:nodes'])