chore(core): cleanup
This commit is contained in:
@@ -15,9 +15,9 @@ const {
|
|||||||
...props
|
...props
|
||||||
} = defineProps<HandleProps>()
|
} = defineProps<HandleProps>()
|
||||||
|
|
||||||
const type = toRef(props, 'type', 'source')
|
const type = toRef(() => props.type ?? 'source')
|
||||||
|
|
||||||
const isValidConnection = toRef(props, 'isValidConnection', undefined)
|
const isValidConnection = toRef(() => props.isValidConnection ?? null)
|
||||||
|
|
||||||
const {
|
const {
|
||||||
connectionStartHandle,
|
connectionStartHandle,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { ToRefs } from 'vue'
|
import type { Ref, ToRefs } from 'vue'
|
||||||
import { effectScope, nextTick, onScopeDispose, toRef, watch } from 'vue'
|
import { effectScope, nextTick, onScopeDispose, toRef, watch } from 'vue'
|
||||||
import type { WatchPausableReturn } from '@vueuse/core'
|
import type { WatchPausableReturn } from '@vueuse/core'
|
||||||
import { watchPausable } from '@vueuse/core'
|
import { watchPausable } from '@vueuse/core'
|
||||||
@@ -287,15 +287,15 @@ export function useWatchProps(
|
|||||||
|
|
||||||
Object.keys(props).forEach((prop) => {
|
Object.keys(props).forEach((prop) => {
|
||||||
if (!skip.includes(prop as keyof typeof props)) {
|
if (!skip.includes(prop as keyof typeof props)) {
|
||||||
const model = toRef(props, prop as keyof typeof props)
|
const model = toRef(() => prop)
|
||||||
const storedValue = store[prop as keyof typeof store] as typeof model
|
const storeRef = store[prop as keyof typeof store] as typeof model as Ref<any>
|
||||||
|
|
||||||
scope.run(() => {
|
scope.run(() => {
|
||||||
watch(
|
watch(
|
||||||
model,
|
model,
|
||||||
(nextValue) => {
|
(nextValue) => {
|
||||||
if (isDef(nextValue)) {
|
if (isDef(nextValue)) {
|
||||||
storedValue.value = nextValue
|
storeRef.value = nextValue
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ flush: 'pre' },
|
{ flush: 'pre' },
|
||||||
|
|||||||
Reference in New Issue
Block a user