fix(types): use correct edge event types
# What's changed? * instead of `MouseEvent`, emit `EdgeMouseEvent` type * fix examples
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user