fix(types): use correct edge event types

# What's changed?

* instead of `MouseEvent`, emit `EdgeMouseEvent` type
* fix examples
This commit is contained in:
braks
2022-07-22 16:56:10 +02:00
committed by Braks
parent 3537e6b022
commit d96e944a49
13 changed files with 56 additions and 43 deletions
@@ -25,8 +25,8 @@ const initialElements: Elements = [
const elements = ref(initialElements)
const onLoad = (flowInstance: VueFlowStore) => flowInstance.fitView()
const onEdgeUpdateStart = (edge: Edge) => console.log('start update', edge)
const onEdgeUpdateEnd = (edge: Edge) => console.log('end update', edge)
const onEdgeUpdateStart = ({ edge }: FlowEvents['edgeUpdateStart']) => console.log('start update', edge)
const onEdgeUpdateEnd = ({ edge }: FlowEvents['edgeUpdateEnd']) => console.log('end update', edge)
const onEdgeUpdate = ({ edge, connection }: FlowEvents['edgeUpdate']) => {
elements.value = updateEdge(edge, connection, elements.value)
}