Skip to content

Commit 75cb0c9

Browse files
committed
chore(core): cleanup
1 parent 7cc798a commit 75cb0c9

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

packages/core/src/components/Handle/Handle.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ const {
1515
...props
1616
} = defineProps<HandleProps>()
1717
18-
const type = toRef(props, 'type', 'source')
18+
const type = toRef(() => props.type ?? 'source')
1919
20-
const isValidConnection = toRef(props, 'isValidConnection', undefined)
20+
const isValidConnection = toRef(() => props.isValidConnection ?? null)
2121
2222
const {
2323
connectionStartHandle,

packages/core/src/composables/useWatchProps.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { ToRefs } from 'vue'
1+
import type { Ref, ToRefs } from 'vue'
22
import { effectScope, nextTick, onScopeDispose, toRef, watch } from 'vue'
33
import type { WatchPausableReturn } from '@vueuse/core'
44
import { watchPausable } from '@vueuse/core'
@@ -287,15 +287,15 @@ export function useWatchProps(
287287

288288
Object.keys(props).forEach((prop) => {
289289
if (!skip.includes(prop as keyof typeof props)) {
290-
const model = toRef(props, prop as keyof typeof props)
291-
const storedValue = store[prop as keyof typeof store] as typeof model
290+
const model = toRef(() => prop)
291+
const storeRef = store[prop as keyof typeof store] as typeof model as Ref<any>
292292

293293
scope.run(() => {
294294
watch(
295295
model,
296296
(nextValue) => {
297297
if (isDef(nextValue)) {
298-
storedValue.value = nextValue
298+
storeRef.value = nextValue
299299
}
300300
},
301301
{ flush: 'pre' },

0 commit comments

Comments
 (0)