DataTables jQuery插件:与vue.js混合时禁用排序和分页

时间:2019-03-11 10:02:36

标签: javascript jquery datatables

我有一个非常简单的DataTables jQuery插件示例,其中包含一个简单的javascript源,该源在基本的Vue.js绑定之前呈现:

JavaScript:

LIBS = /LIBPATH:<path_to_openSSL_dir>lib /LIBPATH:<path_to_icu_dir>\lib "C:\Program Files (x86)\Windows Kits\10\lib\10.0.15063.0\um\x64\icuin.lib" "C:\Program Files (x86)\Windows Kits\10\lib\10.0.15063.0\um\x64\icuuc.lib" <path_to_icu_dir>\lib\icudt.lib

HTML:

           var aDemoItems =[
            {
                "name":       "Tiger Nixon",
                "position":   "System Architect",
                "salary":     "$3,120",
                "start_date": "2011/04/25",
                "office":     "Edinburgh",
                "extn":       "5421"
            },
            {
                "name":       "Garrett Winters",
                "position":   "Director",
                "salary":     "$5,300",
                "start_date": "2011/07/25",
                "office":     "Edinburgh",
                "extn":       "8422"
            },
            {
                "name":       "Vivou fou",
                "position":   "Lazy nephew",
                "salary":     "$7,300",
                "start_date": "2010/04/22",
                "office":     "Edinburgh",
                "extn":       "8422"
            }
        ]

        $('#missionTable').DataTable({
                            data: aDemoItems,
                            columns: [
                                { data: 'name' },
                                { data: 'position' },
                                { data: 'salary' },
                                { data: 'office' }
                            ]
                        });

 var app = new Vue({
                    el: '#app',
                    data: {
                        name: packageName,
                        path: packagePath,
                        data: missionsData
                    }
                })

它可以正常工作,但是如果在控制台中没有出现错误的情况下使用vue.js,则将禁用搜索,排序,nb项目显示和分页 enter image description here

您知道哪里出了问题以及如何同时使用Datatable和vue.js吗?

0 个答案:

没有答案