-
-
Notifications
You must be signed in to change notification settings - Fork 51
Open
Description
Hi
<script setup>
const list = ref([1,2,3])
</script>
<template>
<Draggable :list="list"> <!-- <<< here -->
...
I expect: the list not will be change
Why? Because :list="list"
is a prop
If we want to change, should work two ways:
- either
<Draggable v-model="list">
<Draggable :model-value="list2" @update:model-value="list2 = $event">
- or
<Draggable :list="list" @change="manualChangeList">
but not
<Draggable :list="list">
https://vuejs.org/guide/components/props.html#one-way-data-flow
I caught unexpected behavior, which gave rise to a couple of bugs in my code that I had to look for
Metadata
Metadata
Assignees
Labels
No labels