Closed bbfpl closed 2 years ago
` .... const setRef = (el: HTMLDivElement) => { card.value = drag(drop(el)) as HTMLDivElement }
onMounted(() => { console.log('创建') }) onUnmounted(() => { console.log('销毁') }) onUpdated(() => { console.log('更新') }) ` 这个代码是examples\04-sortable\simple\Card.vue 里就可以复现的,想知道为什么拖拽会导致更新
在这个示例中,每次移动都会实时改变数据的index,所以会触发onUpdated
` .... const setRef = (el: HTMLDivElement) => { card.value = drag(drop(el)) as HTMLDivElement }
onMounted(() => { console.log('创建') }) onUnmounted(() => { console.log('销毁') }) onUpdated(() => { console.log('更新') }) ` 这个代码是examples\04-sortable\simple\Card.vue 里就可以复现的,想知道为什么拖拽会导致更新