鍍金池/ 問(wèn)答/網(wǎng)絡(luò)安全  HTML/ vue-sortable 使用報(bào)錯(cuò)是什么原因?

vue-sortable 使用報(bào)錯(cuò)是什么原因?

在vue2.0中 使用vue-sortable 報(bào)錯(cuò),報(bào)錯(cuò)信息如下:
[Vue warn]: Error in directive sortable update hook: "Sortable: el must be HTMLElement, and not [object Undefined]"
使用sortable的代碼如下:

import Sortable from 'vue-sortable'
Vue.use(Sortable);

        <div id="frame_layout"  v-sortable>

            <div class="frame_group_div">
                1
            </div>

            <div class="frame_group_div">
                2
            </div>
            <div class="frame_group_div">
                3
            </div>
        </div>

github 上也是這樣的用法,請(qǐng)問(wèn)在vue 中如何使用vue-sortable?

回答
編輯回答
巫婆

這個(gè)vue-sortable不支持vue2.0
vue2.0 應(yīng)該使用Vue-Draggable
github地址:https://github.com/SortableJS...

2017年12月28日 15:31