下面的代码允许将组拖入toListFetchRouteA1
:
<draggable id="first" data-source="juju" :list="toListFetchRouteA1" class="list-group" draggable=".item" group="a">
<div class="list-group-item item" v-for="teamfetch in toListFetchRouteA1" :key="teamfetch.id">
<div v-for="personame in teamfetch.Team_player_sessions" :key="personame.id">
{{personame.Player.Person.first_name}}
</div>
</div>
</draggable>
我试图允许拖动每个人的姓名而不是按组,所以我改为:list="toListFetchRouteA1"
(:list="teamfetch.Team_player_sessions"
如下所示),但它会引发错误:无法读取未定义的属性'Team_player_sessions'。
<draggable id="first" data-source="juju" :list="teamfetch.Team_player_sessions" class="list-group" draggable=".item" group="a">
<div v-for="teamfetch in toListFetchRouteA1" :key="teamfetch.id">
<div class="list-group-item item" v-for="personame in teamfetch.Team_player_sessions" :key="personame.id">
{{personame.Player.Person.first_name}}
</div>
</div>
</draggable>
它也没有拖动。有没有办法让div v-for="personame in teamfetch.Team_player_sessions
可拖动的personname
?