如何创建一个Vue.draggable水平列表?

xn1cxnb4  于 2023-04-21  发布在  Vue.js
关注(0)|答案(1)|浏览(160)

我有一个图像列表,我想拖动与拖动,尝试使用direction标签,但它并没有改变任何东西,有什么办法,我可以使列表水平?

<div class="tier-sort">
  <draggable v-model="items" direction="horizontal">
    <div 
      v-for="item in items" 
      :key="item.id" 
      class="tier-item" 
      :style="item.image"
    >
    </div>
  </draggable>
</div>
y53ybaqx

y53ybaqx1#

让我们尝试使用css。对我来说,我使用引导,所以我只是添加

class="d-flex"

代码在这里

<Draggable class="d-flex" v-model="questions" group="people" item-key="id">
      <template #item="{ element }">
        <FormQuestion :question="element" :key="element.id" />
      </template>
    </Draggable>

相关问题