index.vue
<template>
<view class="content">
<!-- 拖拽插件 -->
<vuedraggable class="wrapper" v-model="List">
<!-- 过度效果 -->
<transition-group>
<view v-for="(item,index) in List" :key="index" class="item" @click="fnResetState(index)">
<p>{{item.name}}</p>
</view>
</transition-group>
</vuedraggable>
</view>
</template>
<script>
import vuedraggable from 'vuedraggable'
export default {
components: {
vuedraggable,
},
data() {
return {
List: [{
name: '鲜花11',
state: false,
}, {
name: '鲜花22',
state: false,
}],
inputValue: '',
selectIndex: -1
}
},
onLoad() {
},
methods: {
fnResetState(index) {
console.log(index)
}
}
}
</script>
<style>
.content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.wrapper {
display: flex;
justify-content: center;
width: 100%;
}
.item {
width: 300px;
height: 50px;
background-color: #42b983;
color: #ffffff;
margin-bottom: 10px;
}
</style>
在h5上面点击fnResetState跟拖动排序都会有效,但是在运行到手机上面的时候,拖拽排序不会换位置,点击事件也不生效。难道app阻止什么东西吗?
下面是整个文件夹?能麻烦帮忙看下是什么问题吗