Skip to content

Commit

Permalink
chore(core): use define slots
Browse files Browse the repository at this point in the history
  • Loading branch information
bcakmakoglu committed Oct 6, 2023
1 parent c7cdcaa commit e54fc8c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
4 changes: 1 addition & 3 deletions docs/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
// @ts-nocheck
// Generated by unplugin-vue-components
// Read more: https://github.com/vuejs/core/pull/3399
import '@vue/runtime-core'

export {}

declare module '@vue/runtime-core' {
declare module 'vue' {
export interface GlobalComponents {
Acknowledgement: typeof import('./../components/home/Acknowledgement.vue')['default']
Additional: typeof import('./../components/home/flows/Additional.vue')['default']
Expand Down
11 changes: 9 additions & 2 deletions packages/core/src/container/VueFlow/VueFlow.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<script lang="ts" setup>
import type { D3ZoomEvent } from 'd3-zoom'
import { useVModel } from '@vueuse/core'
import { onMounted, onUnmounted, provide, ref, useSlots } from 'vue'
import type { D3ZoomEvent } from 'd3-zoom'
import Viewport from '../Viewport/Viewport.vue'
import A11yDescriptions from '../../components/A11y/A11yDescriptions.vue'
import type { FlowElements, FlowProps } from '../../types/flow'
import type {
Connection,
ConnectionLineProps,
EdgeChange,
EdgeMouseEvent,
EdgeUpdateEvent,
Expand Down Expand Up @@ -129,6 +130,12 @@ const emit = defineEmits<{
(event: 'update:edges', value: GraphEdge[]): void
}>()
defineSlots<{
'connection-line'(connectionLineProps: ConnectionLineProps): any
'zoom-pane'(): any
'default'(): any
}>()
const modelValue = useVModel(props, 'modelValue', emit)
const modelNodes = useVModel(props, 'nodes', emit)
const modelEdges = useVModel(props, 'edges', emit)
Expand Down Expand Up @@ -188,7 +195,7 @@ export default {
</template>
</template>

<template #connection-name>
<template #connection-line>
<slot name="connection-line" />
</template>

Expand Down
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e54fc8c

Please sign in to comment.