-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
现在新增删除传过去的数据 如何能做成响应式的 #9
Comments
我也是遇到这个问题 |
I also encountered this. To solve it, I implemented this custom condition:
This momentarily de-renders the draggable container and re-renders it with different state. |
@agm1984 thanks, it works. Here's my sample codes: <template>
<draggable v-model="imageList" v-if="imageList.length > 0 && visible">
<template v-slot:item="{ item }">
<el-image :src="item" />
</template>
</draggable>
</template>
<script>
import Draggable from 'vue3-draggable'
export default {
components: { Draggable },
data () {
return {
visible: true,
imageList: []
}
},
methods: {
async addImage (file) {
this.imageList.push(...get image link from somewhere...)
this.visible = false
this.$nextTick(() => {
this.visible = true
})
}
}
}
</script> |
@agm1984 You should create a pr for this implementation this helped me out after struggling with the package for a while |
@wwwossai Very grateful for the decision. It helped me. |
I suppose you ment to report "Pappyskull1"? |
Why ping me? I've been getting some harassment notifications lately, it's very annoying. |
Just report all of them and send the comment's link in the form as a proof. Got 20+ profiles be taken down in the last month. |
现在传过去的数据列表想新增一条数据或者删除一条数据 都不能响应式的去更新,只能重新渲染这个组件才能更新,应为setup只走了一次
The text was updated successfully, but these errors were encountered: